add BoolConstant

This commit is contained in:
q66 2016-01-16 18:33:52 +00:00
parent 9e4d475488
commit 460cded195
2 changed files with 24 additions and 2 deletions

19
ostd/#limits.hh# Normal file
View 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

View file

@ -59,8 +59,11 @@ struct Constant {
constexpr Value operator()() const { return value; } constexpr Value operator()() const { return value; }
}; };
using True = Constant<bool, true>; template<bool val>
using False = Constant<bool, false>; using BoolConstant = Constant<bool, val>;
using True = BoolConstant<true>;
using False = BoolConstant<false>;
template<typename T, T val> constexpr T Constant<T, val>::value; template<typename T, T val> constexpr T Constant<T, val>::value;