Number concept used for representation

This commit is contained in:
Mateusz Pusz committed 2018-10-19 13:02:58 +02:00
1 parent e0511669cf
commit 4e74617e2a
4 files changed
+125 -87

No files matched your search

+16
View File
@@ -30,6 +30,22 @@ namespace units {
using namespace mp::std_concepts; // todo Remove when std::concepts will arrive
template<typename T>
concept bool Number = requires(T a, T b) {
{ a + b} -> T;
{ a - b } -> T;
{ a * b } -> T;
{ a / b } -> T;
{ -a } -> T;
{ a += b } -> T&;
{ a -= b } -> T&;
{ a *= b } -> T&;
{ a /= b } -> T&;
{ T{0} };// can construct a T from a zero
// …
} ;
// static_sign
template<std::intmax_t Pn>