Skip to content

Commit eb5de4a

Browse files
authored
Fix char_traits.h for C++17 (#250)
The char8_t type is only available if __cplusplus >= 201811L. Fix the "implicit 'typename' is a C++20 extension" warning as well.
1 parent 21d3cee commit eb5de4a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/cista/char_traits.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ struct std_char_traits_helper {
127127
};
128128

129129
template <typename CharT>
130-
using char_traits = std::conditional_t<
130+
using char_traits = typename std::conditional_t<
131131
std::disjunction_v<std::is_same<CharT, char>, std::is_same<CharT, wchar_t>,
132+
#if __cplusplus >= 201811L
132133
std::is_same<CharT, char8_t>,
134+
#endif
133135
std::is_same<CharT, char16_t>,
134136
std::is_same<CharT, char32_t>>,
135137
std_char_traits_helper<CharT>, gen_char_traits_helper<CharT>>::value_type;

0 commit comments

Comments
 (0)