Listing 6

// Compile-time selection

// primary template chooses T when b is true
template <bool b , typename T , typename F>
struct If_else
{
    typedef T result;  
};
// specialization choses F when b is false
template <typename T , typename F>  
struct If_else <false , T , F>
{
    typedef F result;
};