A lot of people will read this and think "damn C++ is such an ugly language, it should never allow the programmer to do this!".
The reality is that that kind of technique allows to produce extremely fast code because the compiler has got so much "certain" information at compile time that it can optimize very aggressively.
It's more powerful than vanilla C macros because it works with the compiler, not the pre-processor.
8 comments
[ 2.8 ms ] story [ 25.8 ms ] threadhttp://www.boost.org/doc/libs/1_44_0/libs/spirit/phoenix/doc...
It's just a tutorial on how such things are done. :)
The reality is that that kind of technique allows to produce extremely fast code because the compiler has got so much "certain" information at compile time that it can optimize very aggressively.
It's more powerful than vanilla C macros because it works with the compiler, not the pre-processor.
YMMV whether that's a blessing or a curse, though!