Sequoia
Loading...
Searching...
No Matches
sequoia::is_compatible< T, U > Struct Template Reference

class template for determining if a type is compatible with a floating-point type. More...

#include <TypeTraits.hpp>

Inheritance diagram for sequoia::is_compatible< T, U >:

Detailed Description

template<std::floating_point T, class U>
struct sequoia::is_compatible< T, U >

class template for determining if a type is compatible with a floating-point type.

The goal is to forbid e.g. multiplication of a float by a double, but to allow multiplication of a float by an integral type, even though the latter operation may also lead to a loss of precision. Thus, for an instance x of a type which both wraps a float and defines *=, this utility can be used to allow x *= 2 but forbid x *= 2.2. The idea is to strike a balance between ergonomics and loss of precision.


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