While reading this I was amazed on what a certain level of metaprogramming can do for your class layout. I must admit that I don't fully grasp what's the proposed optimal layout, if I had to state what I understood it would be this :
ordering class member by descending alignment i.e. the type with the greatest
alignof
result goes first etc
Feel free to correct me if I got this wrong (if you had a short explanation of why this happens it would be even better, I couldn't copy paste large chunks of the rationale in my question), but my question is on another topic :
Does any library implementation of std::tuple
have such an optimization of layout?
If not, are there any standard algebraic data types that do so, is there another way to do this for my class apart from writing such a machinery ?