Skip to content

Commit 3ea5bb5

Browse files
committed
Replace traits in BasicFormatParameter user-defined constructor
There is now a BasicFormatTraits::is_user_defined trait that may be used instead of manually specifying this long list.
1 parent 94a60a9 commit 3ea5bb5

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

fly/types/string/detail/format_parameters.hpp

+2-14
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,7 @@ class BasicFormatParameter
121121
*
122122
* @param value The user-defined value.
123123
*/
124-
template <
125-
typename T,
126-
fly::disable_if_any<
127-
detail::is_like_supported_string<T>,
128-
BasicFormatTraits::is_pointer<T>,
129-
std::is_arithmetic<T>,
130-
BasicFormatTraits::is_default_formatted_enum<T>> = 0>
124+
template <typename T, fly::enable_if<BasicFormatTraits::is_user_defined<T>> = 0>
131125
explicit constexpr BasicFormatParameter(const T &value) noexcept;
132126

133127
/**
@@ -336,13 +330,7 @@ constexpr inline BasicFormatParameter<FormatContext>::BasicFormatParameter() noe
336330

337331
//==================================================================================================
338332
template <typename FormatContext>
339-
template <
340-
typename T,
341-
fly::disable_if_any<
342-
detail::is_like_supported_string<T>,
343-
BasicFormatTraits::is_pointer<T>,
344-
std::is_arithmetic<T>,
345-
BasicFormatTraits::is_default_formatted_enum<T>>>
333+
template <typename T, fly::enable_if<BasicFormatTraits::is_user_defined<T>>>
346334
constexpr inline BasicFormatParameter<FormatContext>::BasicFormatParameter(const T &value) noexcept
347335
:
348336
m_type(Type::UserDefined),

0 commit comments

Comments
 (0)