https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87016

--- Comment #4 from bobogu at atlas dot cz ---
(In reply to Jonathan Wakely from comment #3)
> (In reply to bobogu from comment #2)
> When you assign an int to optional<int> it is equivalent to constructing a
> temporary optional<int> and then assigning that to the left-hand operand.

I feel stupid, but I still don't understand how that can work in a constexpr
context when the current c++17 standard doesn't specify any constexpr
assignment operator. 

The second line of this snippet
  std::optional<int> bar = 3;
  bar = std::optional<int>(10);

would call the 3rd assignment operator
(https://en.cppreference.com/w/cpp/utility/optional/operator%3D), right? And
the operator isn't constexpr, but works in a constexpr function.

Reply via email to