|
ScL Feature 0.0.1
C++20 composable proxy wrapper with pluggable executor strategy
|
Lazy-locking cast utility for wrapper and plain value references. More...
Classes | |
| class | scl::wrapper_caster< Refer > |
| Lazy-locking cast proxy for a wrapper or plain value reference. More... | |
Functions | |
| template<typename Value> | |
| constexpr decltype(auto) | scl::wrapper_cast (Value &&v) noexcept |
| Pass-through overload for non-wrapper types — returns the reference unchanged. | |
| template<typename Wrapper> | |
| constexpr decltype(auto) | scl::wrapper_cast (Wrapper &&w) |
| Returns a lazy-locking cast proxy for a wrapper reference. | |
Lazy-locking cast utility for wrapper and plain value references.
scl::wrapper_cast() returns a wrapper_caster<Refer> proxy that captures references to every executor in the wrapper chain without acquiring any guard. Guards are activated lazily, only at the moment the proxy is converted to the desired target type.
This allows generic code to cast uniformly through wrapper chains: non-wrapper types are passed through as-is via a no-op overload.
|
nodiscardconstexprnoexcept |
Pass-through overload for non-wrapper types — returns the reference unchanged.
Allows generic code to call wrapper_cast() uniformly on both wrapper and non-wrapper values.
| Value | Any non-wrapper type. |
| v | Forwarding reference to the value. |
v forwarded as-is (no allocation, no guard).
|
nodiscardconstexpr |
Returns a lazy-locking cast proxy for a wrapper reference.
Guards are not acquired at the call site — they are activated lazily when the returned wrapper_caster<Wrapper> is converted to the desired target type.
| Wrapper | A wrapper specialisation (cv-ref qualifiers are ignored for the concept check but propagated into the proxy). |
| w | Forwarding reference to the wrapper. |
wrapper_caster<Wrapper> proxy.