mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-19 11:14:41 +00:00
Cleanup
This commit is contained in:
parent
ff82d8d2b5
commit
61a241f03f
@ -276,15 +276,11 @@
|
|||||||
# define FMT_OPTIMIZE_SIZE 0
|
# define FMT_OPTIMIZE_SIZE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Specifies whether to handle built-in and string types specially.
|
|
||||||
// FMT_BUILTIN_TYPE=0 may result in smaller library size at the cost of higher
|
// FMT_BUILTIN_TYPE=0 may result in smaller library size at the cost of higher
|
||||||
// per-call binary size.
|
// per-call binary size by passing built-in types through the extension API.
|
||||||
#ifndef FMT_BUILTIN_TYPES
|
#ifndef FMT_BUILTIN_TYPES
|
||||||
# define FMT_BUILTIN_TYPES 1
|
# define FMT_BUILTIN_TYPES 1
|
||||||
#endif
|
#endif
|
||||||
#if !FMT_BUILTIN_TYPES && !defined(__cpp_if_constexpr)
|
|
||||||
# error FMT_BUILTIN_TYPES=0 requires constexpr if support
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FMT_APPLY_VARIADIC(expr) \
|
#define FMT_APPLY_VARIADIC(expr) \
|
||||||
using ignore = int[]; \
|
using ignore = int[]; \
|
||||||
@ -2195,7 +2191,7 @@ template <typename Context> class value {
|
|||||||
}
|
}
|
||||||
FMT_CONSTEXPR FMT_INLINE value(const char_type* x FMT_BUILTIN) {
|
FMT_CONSTEXPR FMT_INLINE value(const char_type* x FMT_BUILTIN) {
|
||||||
string.data = x;
|
string.data = x;
|
||||||
if (is_constant_evaluated()) string.size = {};
|
if (is_constant_evaluated()) string.size = 0;
|
||||||
}
|
}
|
||||||
FMT_CONSTEXPR FMT_INLINE value(basic_string_view<char_type> x FMT_BUILTIN) {
|
FMT_CONSTEXPR FMT_INLINE value(basic_string_view<char_type> x FMT_BUILTIN) {
|
||||||
string.data = x.data();
|
string.data = x.data();
|
||||||
@ -2238,11 +2234,6 @@ template <typename Context> class value {
|
|||||||
#if defined(__cpp_if_constexpr)
|
#if defined(__cpp_if_constexpr)
|
||||||
if constexpr (!formattable) type_is_unformattable_for<T, char_type> _;
|
if constexpr (!formattable) type_is_unformattable_for<T, char_type> _;
|
||||||
|
|
||||||
if constexpr (std::is_same<T, int>::value) {
|
|
||||||
int_value = x; // int is always handled as a built-in type.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// T may overload operator& e.g. std::vector<bool>::reference in libc++.
|
// T may overload operator& e.g. std::vector<bool>::reference in libc++.
|
||||||
if constexpr (std::is_same<decltype(&x), remove_reference_t<T>*>::value)
|
if constexpr (std::is_same<decltype(&x), remove_reference_t<T>*>::value)
|
||||||
custom.value = const_cast<value_type*>(&x);
|
custom.value = const_cast<value_type*>(&x);
|
||||||
|
@ -1028,9 +1028,7 @@ FMT_API void print(std::FILE*, string_view);
|
|||||||
FMT_BEGIN_EXPORT
|
FMT_BEGIN_EXPORT
|
||||||
|
|
||||||
// Suppress a misleading warning in older versions of clang.
|
// Suppress a misleading warning in older versions of clang.
|
||||||
#if FMT_CLANG_VERSION
|
FMT_CLANG_PRAGMA(diagnostic ignored "-Wweak-vtables")
|
||||||
# pragma clang diagnostic ignored "-Wweak-vtables"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// An error reported from a formatting function.
|
/// An error reported from a formatting function.
|
||||||
class FMT_SO_VISIBILITY("default") format_error : public std::runtime_error {
|
class FMT_SO_VISIBILITY("default") format_error : public std::runtime_error {
|
||||||
|
Loading…
Reference in New Issue
Block a user