wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
wuzp::IsValidConversion< To, From > Struct Template Reference

Whether converting a From into a To passes the checks of the converting constructor of To, e.g. whether the units of two quantity matrices match. More...

#include <wuzp/core/traits.hpp>

Inherits std::false_type.

Detailed Description

template<typename To, typename... From>
struct wuzp::IsValidConversion< To, From >

Whether converting a From into a To passes the checks of the converting constructor of To, e.g. whether the units of two quantity matrices match.

The converting constructors between similar types are explicit if the conversion is invalid, so that type traits such as std::is_convertible report it as invalid and overloads such as f(VectorInA) and f(VectorInB) are not ambiguous. Direct initialization still reaches the constructor, whose static_assert explains what does not match. A specialization defines each check as a named constant, e.g. RowsMatchV, which the static_asserts reuse.

Definition at line 265 of file traits.hpp.


The documentation for this struct was generated from the following file: