diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-08-30 21:14:37 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-08-30 21:14:37 +0100 |
commit | 4e11afe5b5d73ce90169a2658f019384f2de33e8 (patch) | |
tree | eb91d557907abc481cf0d28de170eb15ce3e4ae3 | |
parent | Add in a template type arg for enable_if (diff) | |
download | libadhocutil-4e11afe5b5d73ce90169a2658f019384f2de33e8.tar.bz2 libadhocutil-4e11afe5b5d73ce90169a2658f019384f2de33e8.tar.xz libadhocutil-4e11afe5b5d73ce90169a2658f019384f2de33e8.zip |
Add constexpr functions for identifying char ranges
-rw-r--r-- | libadhocutil/compileTimeFormatter.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h index 8d60800..bb80edf 100644 --- a/libadhocutil/compileTimeFormatter.h +++ b/libadhocutil/compileTimeFormatter.h @@ -7,6 +7,19 @@ #include "unique.h" namespace AdHoc { + // Template char utils + template<typename char_type> + constexpr bool isdigit(const char_type & ch) + { + return (ch >= '0' && ch <= '9'); + } + + template<typename char_type> + constexpr bool ispositivedigit(const char_type & ch) + { + return (ch >= '1' && ch <= '9'); + } + // Template string utils template<const auto & S> static constexpr auto strlen() |