mirror of
https://github.com/fmtlib/fmt.git
synced 2025-09-08 03:51:58 -04:00
compatible for c++11 but GCC < 5
This commit is contained in:
parent
353bd895a2
commit
f40f93a40d
@ -73,6 +73,12 @@
|
||||
# endif
|
||||
#endif // FMT_MODULE
|
||||
|
||||
#if (defined(__GNUC__) && __GNUC__ < 5) || defined(_MSC_VER)
|
||||
# define OPERATOR_LITERAL(suffix) operator"" suffix
|
||||
#else
|
||||
# define OPERATOR_LITERAL(suffix) operator""suffix
|
||||
#endif
|
||||
|
||||
#if defined(FMT_USE_NONTYPE_TEMPLATE_ARGS)
|
||||
// Use the provided definition.
|
||||
#elif defined(__NVCOMPILER)
|
||||
@ -4050,7 +4056,7 @@ template <typename T, typename Char = char> struct nested_formatter {
|
||||
|
||||
inline namespace literals {
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
template <detail::fixed_string S> constexpr auto operator""_a() {
|
||||
template <detail::fixed_string S> constexpr auto OPERATOR_LITERAL(_a)() {
|
||||
using char_t = remove_cvref_t<decltype(*S.data)>;
|
||||
return detail::udl_arg<char_t, sizeof(S.data) / sizeof(char_t), S>();
|
||||
}
|
||||
@ -4063,7 +4069,7 @@ template <detail::fixed_string S> constexpr auto operator""_a() {
|
||||
* using namespace fmt::literals;
|
||||
* fmt::print("The answer is {answer}.", "answer"_a=42);
|
||||
*/
|
||||
constexpr auto operator""_a(const char* s, size_t) -> detail::udl_arg<char> {
|
||||
constexpr auto OPERATOR_LITERAL(_a)(const char* s, size_t) -> detail::udl_arg<char> {
|
||||
return {s};
|
||||
}
|
||||
#endif // FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
|
Loading…
x
Reference in New Issue
Block a user