From 72e5eaed28381d9c6d5446fffea1cbe81cd4da38 Mon Sep 17 00:00:00 2001 From: Igor Zarzycki Date: Sat, 24 Aug 2024 01:44:10 +0200 Subject: [PATCH] Add hasFacet function checking numpunct. --- CMakeLists.txt | 1 + include/crap/locale | 1 + include/crap/locale.d/hasfacet.h | 135 +++++++++++++++++++++++++++++++ test/hasfacettest.cpp | 24 ++++++ 4 files changed, 161 insertions(+) create mode 100644 include/crap/locale.d/hasfacet.h create mode 100644 test/hasfacettest.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5543148..b1f555c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ crap_test(countlzerovalue) crap_test(countronevalue) crap_test(countrzerovalue) crap_test(floortype) +crap_test(hasfacet) crap_test(hassinglebitvalue) crap_test(innerproductvalue) crap_test(isheapuntilltype) diff --git a/include/crap/locale b/include/crap/locale index 2c75b33..5b6dd4a 100644 --- a/include/crap/locale +++ b/include/crap/locale @@ -1,6 +1,7 @@ #ifndef CRAP_LOCALE #define CRAP_LOCALE +#include "locale.d/hasfacet.h" #include "locale.d/isalnumvalue.h" #include "locale.d/isalphavalue.h" #include "locale.d/isblankvalue.h" diff --git a/include/crap/locale.d/hasfacet.h b/include/crap/locale.d/hasfacet.h new file mode 100644 index 0000000..6ee86e3 --- /dev/null +++ b/include/crap/locale.d/hasfacet.h @@ -0,0 +1,135 @@ +#ifndef CRAP_LOCALE_HASFACET +#define CRAP_LOCALE_HASFACET + +#include +#include +#include +#include + +#include "numpunct.h" +#include "../algorithm.d/countiftype.h" +#include "../type_traits.d/voidt.h" +#include "../version.d/libintegralconstantcallable.h" + +namespace crap +{ + template struct hasFacet; + + template struct hasFacet, Locale> + { + private: + template struct isNumpunct; + template class> struct isLocaleHaving; + template