Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -2253,20 +2253,20 @@ template <typename Context> class value {
string.data = sv.data();
string.size = sv.size();
}
FMT_INLINE value(void* x FMT_BUILTIN) : pointer(x) {}
FMT_INLINE value(const void* x FMT_BUILTIN) : pointer(x) {}
FMT_INLINE value(volatile void* x FMT_BUILTIN)
constexpr FMT_INLINE value(void* x FMT_BUILTIN) : pointer(x) {}
constexpr FMT_INLINE value(const void* x FMT_BUILTIN) : pointer(x) {}
constexpr FMT_INLINE value(volatile void* x FMT_BUILTIN)
: pointer(const_cast<const void*>(x)) {}
FMT_INLINE value(const volatile void* x FMT_BUILTIN)
constexpr FMT_INLINE value(const volatile void* x FMT_BUILTIN)
: pointer(const_cast<const void*>(x)) {}
FMT_INLINE value(nullptr_t) : pointer(nullptr) {}
constexpr FMT_INLINE value(nullptr_t) : pointer(nullptr) {}

template <typename T,
FMT_ENABLE_IF(
(std::is_pointer<T>::value ||
std::is_member_pointer<T>::value) &&
!std::is_void<typename std::remove_pointer<T>::type>::value)>
value(const T&) {
constexpr value(const T&) {
// Formatting of arbitrary pointers is disallowed. If you want to format a
// pointer cast it to `void*` or `const void*`. In particular, this forbids
// formatting of `[const] volatile char*` printed as bool by iostreams.
Expand All @@ -2275,12 +2275,12 @@ template <typename Context> class value {
}

template <typename T, FMT_ENABLE_IF(use_format_as<T>::value)>
value(const T& x) : value(format_as(x)) {}
constexpr value(const T& x) : value(format_as(x)) {}
template <typename T, FMT_ENABLE_IF(use_format_as_member<T>::value)>
value(const T& x) : value(formatter<T>::format_as(x)) {}
constexpr value(const T& x) : value(formatter<T>::format_as(x)) {}

template <typename T, FMT_ENABLE_IF(is_named_arg<T>::value)>
value(const T& named_arg) : value(named_arg.value) {}
constexpr value(const T& named_arg) : value(named_arg.value) {}

template <typename T,
FMT_ENABLE_IF(use_formatter<T>::value || !FMT_BUILTIN_TYPES)>
Expand Down