@@ -277,7 +277,7 @@ template <size_t N> struct fixed_string {
277
277
bool correct_flag{true};
278
278
template <typename T> constexpr fixed_string(const T (&input)[N+1]) noexcept {
279
279
if constexpr (std::is_same_v<T, char>) {
280
- #if CTRE_STRING_IS_UTF8
280
+ #ifdef CTRE_STRING_IS_UTF8
281
281
size_t out{0};
282
282
for (size_t i{0}; i < N; ++i) {
283
283
if ((i == (N-1)) && (input[i] == 0)) break;
@@ -444,12 +444,6 @@ template <size_t N> fixed_string(fixed_string<N>) -> fixed_string<N>;
444
444
445
445
}
446
446
447
- #if CTLL_CNTTP_COMPILER_CHECK
448
- #define CTLL_FIXED_STRING ctll::fixed_string
449
- #else
450
- #define CTLL_FIXED_STRING const auto &
451
- #endif
452
-
453
447
#endif
454
448
455
449
#ifndef CTLL__TYPE_STACK__HPP
@@ -460,7 +454,23 @@ template <size_t N> fixed_string(fixed_string<N>) -> fixed_string<N>;
460
454
461
455
#include <type_traits>
462
456
463
- #define CTLL_CNTTP_COMPILER_CHECK (__cpp_nontype_template_parameter_class || (__cpp_nontype_template_args >= 201911L) || ((__cpp_nontype_template_args >= 201411L) && (__clang_major__ >= 12) && !__apple_build_version__))
457
+ #if defined __cpp_nontype_template_parameter_class
458
+ #define CTLL_CNTTP_COMPILER_CHECK 1
459
+ #elif defined __cpp_nontype_template_args
460
+ #if __cpp_nontype_template_args >= 201911L
461
+ #define CTLL_CNTTP_COMPILER_CHECK 1
462
+ #elif __cpp_nontype_template_args >= 201411L
463
+ #if defined __clang_major__ && __clang_major__ >= 12
464
+ #if !defined __apple_build_version__ || !__apple_build_version__
465
+ #define CTLL_CNTTP_COMPILER_CHECK 1
466
+ #endif
467
+ #endif
468
+ #endif
469
+ #endif
470
+
471
+ #ifndef CTLL_CNTTP_COMPILER_CHECK
472
+ #define CTLL_CNTTP_COMPILER_CHECK 0
473
+ #endif
464
474
465
475
#ifdef _MSC_VER
466
476
#define CTLL_FORCE_INLINE __forceinline
@@ -1340,7 +1350,7 @@ struct pcre {
1340
1350
#ifndef CTRE__UTILITY__HPP
1341
1351
#define CTRE__UTILITY__HPP
1342
1352
1343
- #define CTRE_CNTTP_COMPILER_CHECK (__cpp_nontype_template_parameter_class || (__cpp_nontype_template_args >= 201911L) || ((__cpp_nontype_template_args >= 201411L) && (__clang_major__ >= 12) && !__apple_build_version__))
1353
+ #define CTRE_CNTTP_COMPILER_CHECK CTLL_CNTTP_COMPILER_CHECK
1344
1354
1345
1355
#if __GNUC__ > 9
1346
1356
#if __has_cpp_attribute(likely)
@@ -4790,7 +4800,7 @@ template <typename... Ts> constexpr bool is_range<multi_subject_range<Ts...>> =
4790
4800
4791
4801
}
4792
4802
4793
- #if __cpp_lib_ranges >= 201911
4803
+ #if defined __cpp_lib_ranges && __cpp_lib_ranges >= 201911
4794
4804
namespace std::ranges {
4795
4805
4796
4806
template <typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::regex_range<Ts...>> = true;
0 commit comments