This is not mandated by the Standard, but it's nonetheless a nice
property to have, especially since it's so easy to implement. It
also shrinks our bug list!
PR41714
Differential D62618
[libcxx] Make std::tuple<> trivially constructible ldionne on May 29 2019, 12:12 PM. Authored by
Details This is not mandated by the Standard, but it's nonetheless a nice PR41714
Diff Detail
Event TimelineComment Actions Other than the "this is not standard behavior", and my general feeling about "things that everyone does, but aren't in the standard", I'm fine with this. Comment Actions I opened a LWG issue per your request, I'm waiting for the LWG chair (hmm, I wonder who that is) to give me an issue number 🙃. Comment Actions Changing the triviality of a type can be ABI breaking because it will change the calling conventions the compiler uses. I'm not sure if this case triggers that change (it may only be when you change is_trivially_copyable). But we need to double check.
Comment Actions Right, I think we at least need a macro to choose the ABI so that (a) vendors can pick a default and (b) users can override it. Comment Actions I was going to close PR41714 as "Can't fix, this is an ABI break", but then I checked the Itanium C++ ABI and it did not mention default constructors. Here, it says:
I'd welcome a double-check, but I think this isn't ABI breaking. Otherwise the resolution is evident, y'all know me :-).
Comment Actions Thanks for the link Louis. This should be safe then. .
Comment Actions Just to confirm, @mclow.lists are we OK with this since the LWG issue has been filed? |
This is C++11 and up so you can just write = default.