Should std::byte copy-list-initialization fail?
Jonathan Wakely
jwakely.gcc@gmail.com
Mon Jul 17 11:42:00 GMT 2017
On 17 July 2017 at 09:15, Jeffrey Walton wrote:
> The comments explain my confusion. It seemed like both should succeed,
> or both should fail.
No, because there's no implicit conversion. This is consistent with
'explicit' constructors:
struct S {
explicit S(int) { }
};
S s = { 0 }; // error
S s{ 0 }; // ok
> It looks like special accommodations were made
> for list-initialization under C++17.
Yes, see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0138r2.pdf
More information about the Gcc-help
mailing list