This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Should std::byte copy-list-initialization fail?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]