That's fantastic! Thank you for your recommendation.
Στις 4:32 μ.μ. Παρασκευή, 20 Μαρτίου 2015, ο/η Mathias Gaunard
On 20/03/2015 16:59, costis glynos wrote:
Hello,Is there any interest in a library which automatically sorts types from smallest to largest at compile time?The benefit would be the automatic Data Structure Alignment and potential improvement in performance.Foo
foo_1; //normal Foo foo_2; //using the TypeSort output: size of foo_1 = 48 size of foo_2 = 32 Kind Regards, There is already a sort meta-function in Boost.MPL. http://www.boost.org/doc/libs/1_57_0/libs/mpl/doc/refmanual/sort.html
Sweet! Thanks for bringing this to my attention.
You also need to use Boost.Fusion to make it into a tuple at the end,
since this is what you want.
Here is an example:
#include