mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-26 12:35:32 +00:00
Remove FMT_CONSTEXPR_DECL
This commit is contained in:
parent
d6b568a6cc
commit
1761e2666a
@ -298,11 +298,9 @@ class text_style {
|
||||
}
|
||||
}
|
||||
|
||||
friend FMT_CONSTEXPR_DECL text_style
|
||||
fg(detail::color_type foreground) noexcept;
|
||||
friend FMT_CONSTEXPR text_style fg(detail::color_type foreground) noexcept;
|
||||
|
||||
friend FMT_CONSTEXPR_DECL text_style
|
||||
bg(detail::color_type background) noexcept;
|
||||
friend FMT_CONSTEXPR text_style bg(detail::color_type background) noexcept;
|
||||
|
||||
detail::color_type foreground_color;
|
||||
detail::color_type background_color;
|
||||
|
@ -102,10 +102,8 @@
|
||||
#endif
|
||||
#if FMT_USE_CONSTEXPR
|
||||
# define FMT_CONSTEXPR constexpr
|
||||
# define FMT_CONSTEXPR_DECL constexpr
|
||||
#else
|
||||
# define FMT_CONSTEXPR
|
||||
# define FMT_CONSTEXPR_DECL
|
||||
#endif
|
||||
|
||||
#if ((__cplusplus >= 202002L) && \
|
||||
@ -116,7 +114,7 @@
|
||||
# define FMT_CONSTEXPR20
|
||||
#endif
|
||||
|
||||
// Check if constexpr std::char_traits<>::compare,length is supported.
|
||||
// Check if constexpr std::char_traits<>::{compare,length} are supported.
|
||||
#if defined(__GLIBCXX__)
|
||||
# if __cplusplus >= 201703L && defined(_GLIBCXX_RELEASE) && \
|
||||
_GLIBCXX_RELEASE >= 7 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE.
|
||||
@ -253,7 +251,7 @@
|
||||
|
||||
#ifndef FMT_CONSTEVAL
|
||||
# if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \
|
||||
__cplusplus > 201703L && !defined(__apple_build_version__)) || \
|
||||
__cplusplus >= 202002L && !defined(__apple_build_version__)) || \
|
||||
(defined(__cpp_consteval) && \
|
||||
(!FMT_MSC_VERSION || _MSC_FULL_VER >= 193030704))
|
||||
// consteval is broken in MSVC before VS2022 and Apple clang 13.
|
||||
|
@ -2710,7 +2710,7 @@ class bigint {
|
||||
return bigits_[to_unsigned(index)];
|
||||
}
|
||||
|
||||
static FMT_CONSTEXPR_DECL const int bigit_bits = num_bits<bigit>();
|
||||
static constexpr const int bigit_bits = num_bits<bigit>();
|
||||
|
||||
friend struct formatter<bigint>;
|
||||
|
||||
|
@ -55,7 +55,7 @@ template <typename T> class is_std_string_like {
|
||||
template <typename> static void check(...);
|
||||
|
||||
public:
|
||||
static FMT_CONSTEXPR_DECL const bool value =
|
||||
static constexpr const bool value =
|
||||
is_string<T>::value ||
|
||||
std::is_convertible<T, std_string_view<char>>::value ||
|
||||
!std::is_void<decltype(check<T>(nullptr))>::value;
|
||||
@ -70,9 +70,9 @@ template <typename T> class is_map {
|
||||
|
||||
public:
|
||||
#ifdef FMT_FORMAT_MAP_AS_LIST
|
||||
static FMT_CONSTEXPR_DECL const bool value = false;
|
||||
static constexpr const bool value = false;
|
||||
#else
|
||||
static FMT_CONSTEXPR_DECL const bool value =
|
||||
static constexpr const bool value =
|
||||
!std::is_void<decltype(check<T>(nullptr))>::value;
|
||||
#endif
|
||||
};
|
||||
@ -83,9 +83,9 @@ template <typename T> class is_set {
|
||||
|
||||
public:
|
||||
#ifdef FMT_FORMAT_SET_AS_LIST
|
||||
static FMT_CONSTEXPR_DECL const bool value = false;
|
||||
static constexpr const bool value = false;
|
||||
#else
|
||||
static FMT_CONSTEXPR_DECL const bool value =
|
||||
static constexpr const bool value =
|
||||
!std::is_void<decltype(check<T>(nullptr))>::value && !is_map<T>::value;
|
||||
#endif
|
||||
};
|
||||
@ -174,7 +174,7 @@ template <typename T> class is_tuple_like_ {
|
||||
template <typename> static void check(...);
|
||||
|
||||
public:
|
||||
static FMT_CONSTEXPR_DECL const bool value =
|
||||
static constexpr const bool value =
|
||||
!std::is_void<decltype(check<T>(nullptr))>::value;
|
||||
};
|
||||
|
||||
@ -279,7 +279,7 @@ OutputIt write_range_entry(OutputIt out, const Arg& v) {
|
||||
} // namespace detail
|
||||
|
||||
template <typename T> struct is_tuple_like {
|
||||
static FMT_CONSTEXPR_DECL const bool value =
|
||||
static constexpr const bool value =
|
||||
detail::is_tuple_like_<T>::value && !detail::is_range_<T>::value;
|
||||
};
|
||||
|
||||
@ -315,7 +315,7 @@ struct formatter<TupleT, Char, enable_if_t<fmt::is_tuple_like<TupleT>::value>> {
|
||||
};
|
||||
|
||||
template <typename T, typename Char> struct is_range {
|
||||
static FMT_CONSTEXPR_DECL const bool value =
|
||||
static constexpr const bool value =
|
||||
detail::is_range_<T>::value && !detail::is_std_string_like<T>::value &&
|
||||
!detail::is_map<T>::value &&
|
||||
!std::is_convertible<T, std::basic_string<Char>>::value &&
|
||||
|
@ -1829,8 +1829,8 @@ fmt::string_view to_string_view(string_like) { return "foo"; }
|
||||
|
||||
constexpr char with_null[3] = {'{', '}', '\0'};
|
||||
constexpr char no_null[2] = {'{', '}'};
|
||||
static FMT_CONSTEXPR_DECL const char static_with_null[3] = {'{', '}', '\0'};
|
||||
static FMT_CONSTEXPR_DECL const char static_no_null[2] = {'{', '}'};
|
||||
static constexpr const char static_with_null[3] = {'{', '}', '\0'};
|
||||
static constexpr const char static_no_null[2] = {'{', '}'};
|
||||
|
||||
TEST(format_test, compile_time_string) {
|
||||
EXPECT_EQ("foo", fmt::format(FMT_STRING("foo")));
|
||||
|
Loading…
x
Reference in New Issue
Block a user