AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::val::MultipleOf< N > Struct Template Reference

Multiple of constraint ( multipleOf ). More...

#include <constraints.hpp>

Collaboration diagram for anch::val::MultipleOf< N >:

Public Member Functions

template<anch::val::Number V>
bool check (const V &number, std::string &message) const

Public Attributes

N value

Detailed Description

template<anch::val::Number N>
struct anch::val::MultipleOf< N >

Multiple of constraint ( multipleOf ).

Integers are checked exactly. With floating point numbers, the quotient has to be an integer with a relative tolerance ( 0.3 is a multiple of 0.1 ).

Template Parameters
Nthe divisor type
Author
Vincent Lachenal
Since
0.2

Member Function Documentation

◆ check()

template<anch::val::Number N>
template<anch::val::Number V>
bool anch::val::MultipleOf< N >::check ( const V & number,
std::string & message ) const

Check value

Template Parameters
Vthe value type
Parameters
numberthe value
messagethe error message (set when value is invalid)
Returns
true when value is valid

Member Data Documentation

◆ value

template<anch::val::Number N>
N anch::val::MultipleOf< N >::value

Divisor (strictly positive)


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