From 6f1ef63f56e49e0b317921dd6ed936c370d4c3ba Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Fri, 10 Jul 2015 17:54:22 +0300 Subject: [PATCH] Boolean traits --- libuavcan/include/uavcan/util/templates.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libuavcan/include/uavcan/util/templates.hpp b/libuavcan/include/uavcan/util/templates.hpp index aa61ca1cb3..9358a73f36 100644 --- a/libuavcan/include/uavcan/util/templates.hpp +++ b/libuavcan/include/uavcan/util/templates.hpp @@ -326,6 +326,16 @@ bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2) template struct UAVCAN_EXPORT NumericTraits; +/// bool +template <> +struct UAVCAN_EXPORT NumericTraits +{ + enum { IsSigned = 0 }; + enum { IsInteger = 1 }; + static bool max() { return true; } + static bool min() { return false; } +}; + /// char template <> struct UAVCAN_EXPORT NumericTraits