add BoolConstant
This commit is contained in:
parent
9e4d475488
commit
460cded195
19
ostd/#limits.hh#
Normal file
19
ostd/#limits.hh#
Normal file
|
@ -0,0 +1,19 @@
|
|||
/* Various type limits.
|
||||
*
|
||||
* This file is part of OctaSTD. See COPYING.md for futher information.
|
||||
*/
|
||||
|
||||
#ifndef OSTD_LIMTIS_HH
|
||||
#define OSTD_LIMITS_HH
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
namespace ostd {
|
||||
|
||||
template<typename>
|
||||
struct Limits {
|
||||
};
|
||||
|
||||
} /* namespace ostd */
|
||||
|
||||
#endif
|
|
@ -59,8 +59,11 @@ struct Constant {
|
|||
constexpr Value operator()() const { return value; }
|
||||
};
|
||||
|
||||
using True = Constant<bool, true>;
|
||||
using False = Constant<bool, false>;
|
||||
template<bool val>
|
||||
using BoolConstant = Constant<bool, val>;
|
||||
|
||||
using True = BoolConstant<true>;
|
||||
using False = BoolConstant<false>;
|
||||
|
||||
template<typename T, T val> constexpr T Constant<T, val>::value;
|
||||
|
||||
|
|
Loading…
Reference in a new issue