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

The default precision of isApprox() for values of the type ValueT_, which compares relatively: 1e-12 for double and 1e-5 for float. More...

#include <wuzp/core/traits.hpp>

Static Public Member Functions

static constexpr ValueT_ value ()

Detailed Description

template<typename ValueT_>
struct wuzp::Precision< ValueT_ >

The default precision of isApprox() for values of the type ValueT_, which compares relatively: 1e-12 for double and 1e-5 for float.

Integers compare exactly, so their precision is 0, and long double has the precision of double, whose representation it shares with MSVC. Every arithmetic type, the value types of value matrices (see ArithmeticValue in concepts.hpp), has one, since MSVC instantiates the default arguments of isApprox() together with its class, e.g. the values, also where isApprox() is not called. The standard only instantiates them where a call uses them (https://eel.is/c++draft/temp.inst#12), as GCC and Clang do. The primary template is the case of the integers, which rejects the other types, rather than a partial specialization requires std::is_integral_v<ValueT_> struct Precision<ValueT_>, which differs from the primary template only by its constraint, so that the precisions that MSVC needs for every arithmetic type do not rely on its support of such specializations.

Definition at line 354 of file traits.hpp.

Member Function Documentation

◆ value()

template<typename ValueT_>
constexpr ValueT_ wuzp::Precision< ValueT_ >::value ( )
inlinestaticconstexpr

Definition at line 356 of file traits.hpp.


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