TTS v4.0.0
The Tiny Test System
Loading...
Searching...
No Matches
tts::conversion< T, V > Struct Template Reference

How a value is read as another type. More...

Detailed Description

template<typename T, typename V>
struct tts::conversion< T, V >

How a value is read as another type.

Generators funnel their bounds through this, so a bound written once has to answer for every type the case is run on. Specialize it for your own types rather than overloading convert_as. A type without a specialization keeps the built-in cast.

The convert_as free function is the dispatcher rather than a customization point, and the call sites reach it qualified, so an overload of that name in another namespace is never found. It carries a generic default, which is why a leftover cannot be reported the way tts::precision and tts::comparison report theirs.

Template Parameters
TTarget data type
VType of the value being read