This is done using heavy templating wizardy leading to the automation of a lot of complex decisions at compile-time. But why it has to be so complex?
Probably if such considerations (type traits driven compilation) are taken when designing the language, similar features could be used without the complexity. My understanding of Perl6 is that TWBMMMWTDI (There will be many more way to do it). If the user does not provide enough type information that will mean more work at run-time. If the user provides sufficiently typed variables, a lot of decision will be taken at compile-time. One can imagine that such a program could be mostly compiled to native object code.
My dream is a language that allows me to start with very loosely typed code. Once my program will stabilize, I want to be able to add more typing information to get more performance. Sadly, today perl allows to prototype very fast but if one want better performance, one has to move to another language.
My wish for perl6 as language for the 20 years to come is that it will cover the full gamut from interpreted to compiled.
My only grief against the "Modern C++ design book" is the index that could have been more complete. For exemple, the word trait is missing but you will find you way if you search Typetraits instead. Warning: this book is not casual reading. Working knowledge of C++ templates is a prerequisite.