File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 187
187
# define FMT_ASSERT (condition, message ) assert((condition) && message)
188
188
#endif
189
189
190
- // An enable_if helper to be used in template parameters. enable_if in template
191
- // parameters results in much shorter symbols: https://godbolt.org/z/sWw4vP.
192
- #define FMT_ENABLE_IF_T (...) typename std::enable_if<(__VA_ARGS__), int >::type
193
- #define FMT_ENABLE_IF (...) FMT_ENABLE_IF_T(__VA_ARGS__) = 0
194
-
195
190
// libc++ supports string_view in pre-c++17.
196
191
#if (FMT_HAS_INCLUDE(<string_view>) && \
197
192
(__cplusplus > 201402L || defined (_LIBCPP_VERSION))) || \
@@ -215,6 +210,11 @@ using std_string_view = std::experimental::basic_string_view<Char>;
215
210
template <typename T> struct std_string_view {};
216
211
#endif
217
212
213
+ // An enable_if helper to be used in template parameters. enable_if in template
214
+ // parameters results in much shorter symbols: https://godbolt.org/z/sWw4vP.
215
+ template <bool B> using enable_if_t = typename std::enable_if<B, int >::type;
216
+ #define FMT_ENABLE_IF (...) internal::enable_if_t <__VA_ARGS__> = 0
217
+
218
218
#if (__cplusplus >= 201703L || \
219
219
(defined(_MSVC_LANG) && _MSVC_LANG >= 201703L )) && \
220
220
__cpp_lib_is_invocable >= 201703L
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ template <typename Locale> Locale locale_ref::get() const {
223
223
}
224
224
225
225
template <typename Char> FMT_FUNC Char thousands_sep_impl (locale_ref loc) {
226
- return std::use_facet<std::numpunct<Char> >(loc.get <std::locale>())
226
+ return std::use_facet<std::numpunct<Char>>(loc.get <std::locale>())
227
227
.thousands_sep ();
228
228
}
229
229
} // namespace internal
@@ -683,7 +683,7 @@ template <int GRISU_VERSION> struct grisu_shortest_handler {
683
683
}
684
684
};
685
685
686
- template <typename Double, FMT_ENABLE_IF_T( sizeof (Double) == sizeof (uint64_t )) >
686
+ template <typename Double, enable_if_t < sizeof (Double) == sizeof (uint64_t )> >
687
687
FMT_API bool grisu_format (Double value, buffer<char >& buf, int precision,
688
688
unsigned options, int & exp) {
689
689
FMT_ASSERT (value >= 0 , " value is negative" );
Original file line number Diff line number Diff line change @@ -2238,7 +2238,7 @@ FMT_CONSTEXPR bool do_check_format_string(basic_string_view<Char> s,
2238
2238
}
2239
2239
2240
2240
template <typename ... Args, typename S,
2241
- FMT_ENABLE_IF_T ( is_compile_string<S>::value) >
2241
+ internal:: enable_if_t < is_compile_string<S>::value> >
2242
2242
void check_format_string (S format_str) {
2243
2243
typedef typename S::char_type char_t ;
2244
2244
FMT_CONSTEXPR_DECL bool invalid_format =
You can’t perform that action at this time.
0 commit comments