Clarify why we can't have nice things

This commit is contained in:
Victor Zverovich 2024-01-02 19:14:32 -08:00
parent c36ed77ff0
commit 4e43a46993

View File

@ -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);