-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
std::optional<const T> doesn't work #4561
Copy link
Copy link
Closed
Description
fmt::print("{}", std::optional<const int>{}); doesn't compile. Below is my initial analysis (I'm not really familiar with fmt internals):
is_formattable<std::optional<const int>>isfalsebecausehas_formatterisfalsebecausedecltype(formatter<U, Char>().format(*p, *ctx), std::true_type())is SFINAEd out becauseformatter<U, Char>()is invalid because- default ctor for
formatter<std::optional<const int>>is deleted because - default ctor for
formatter<T, Char> underlying_here is deleted because - default ctor for
formatter<const int>is deleted here probably because native_formatteris not selected becausetype_constant<const int>::valueiscustom_typeinstead ofint_type
I can only guess that remove_cv_t is required somewhere in that chain.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels