Skip to content

Commit

Permalink
Clarify why we can't have nice things
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut authored and happymonkey1 committed Apr 6, 2024
1 parent 8ef1a96 commit 4400d35
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@ template <typename Context> class value {

template <typename T> FMT_CONSTEXPR20 FMT_INLINE value(T& val) {
using value_type = remove_const_t<T>;
// T may overload operator& e.g. std::vector<bool>::reference in libc++.
#ifdef __cpp_if_constexpr
if constexpr (std::is_same<decltype(&val), T*>::value)
custom.value = const_cast<value_type*>(&val);
Expand Down

0 comments on commit 4400d35

Please sign in to comment.