ComPPare 1.0.0
|
Specification struct for pairing an output type with an error policy. More...
Specification struct for pairing an output type with an error policy.
The outspec
struct represents an output type together with its error policy. Inside the framework, every argument passed to OutputContext
is normalized into some form of outspec<Value, Policy>
.
OutputContext
normalizes output typesdouble
), it is automatically wrapped as outspec<double, void>
. The void
signals that the framework should deduce the policy via AutoPolicy_t<double>
. This case is handled by the specialization outspec<Value, void>
.set_policy<T, P>
, it is an alias for outspec<T, P>
. Within OutputContext
, this is first normalized as outspec<outspec<T, P>, void>
, in the same way raw types are normalized. This case is handled by the specialization outspec<outspec<Value, Policy>, void>
.Consider a mix of raw types and explicit policies in OutputContext
:
Here:
T1
is normalized as outspec<T1, void>
(auto policy).outspec<T0, P0>
is normalized as outspec<outspec<T0, P0>, void>
.All arguments are first treated as outspec<..., void>
. Without this mechanism, users would have to explicitly write:
which is less convenient, since most users do not need custom policies.
Value | The output value type. |
Policy | The error policy type. Defaults to void for auto-selection. |