Wednesday, January 18, 2006

Modern C++ Design

I would really recommend you to try out "Modern C++ Design by Andrei
Alexandrescu". It is a fantastic book delving deep into C++ Template
Techniques. Its not something a novice can read, but yet if you are
comfortable with C++ templates, then you should definitely give it a
shot!

He opens your eyes to a lot of interesting techniques and in the process
also unravels "Loki", the library (written by him) which implements all
of the techniques!

Policy class, local classes, typelists - the list just goes on, its all
there!! He shows what you can do with even the most simple template
classes viz :-


template<bool>
struct CompileTimeChecker
{
CompileTimeChecker(...) {}
};

template<> struct CompileTimeChecker<false> {};

This relatively simple struct can achieve compile time assertions for
you!

Read it! Its worth it!

Dinesh.

No comments: