According to http://flamingdangerzone.com/cxx11/2012/07/06/optimal-tuple-i.html, with regards to std::tuple...
libstdc++ always places the members in reverse order, and libc++ always places the members in the order given
Assuming that's true, is there a reason (historical or otherwise) why libstdc++ uses reverse order?
Bonus: Has either implementation ever changed its std::tuple ordering for any reason?
See this answer for why libc++ chose forward order. As for why libstdc++ chose reverse order, that is probably because that's how it was demonstrated in the variadics template proposal, and is the more obvious implementation.
Bonus: No. These orderings have been stable in both libraries.
Update
libc++ chose forward storage order because:
In short, the implementor of the libc++ tuple
merely felt that storing the objects in the order the client (implicitly) specified was the quality thing to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With