   Some clarification on this meta-program
  This code, #include <boost/mpl/if.hpp>#include <boost/type_traits/add_reference.hpp>template <class T>struct param_type   : mpl::if_<    typename boost::is_scalar<T>::type    , T    , typename boost::add_reference<T const>::type   >  {};returns T is T is a scaler like, int, float ..., otherwise a T const&.This could be used in say in a parameter of a copy constructor. The book says that the problem with this is that add_reference gets instiantiatedeven if T is a scaler. I assume this is because of how if_<C,T,F> works in boost. But then the book provides this next code :template <class T>struct param_type : mpl::if_< // forwarding to selected transformation  typename boost::is_scalar<T>::type  , mpl::identity<T>  , boost::add_reference<T const> >::type{};The identity just returns T. Now the book says that this is lazy evaluation,in that either mpl::identity<T> is refereed to of boost::add_reference<T const>is refereed to. I am not sure why just adding a metafunction in the second parameter causeseither identity or add_ref to be instantiated. While in the first codeadd_ref gets instantiated even if T is a scaler? Is this how if_<C,T,F> worksor am I missing something.   
int if_(bool scalar, int x, int y) {  if (scalar) {    return x;  } else {    return y;  }}Two ints are instantiated hereInstead, we can have lazily evaluated type:struct lazy {  int type() {    if (value == NULL) value = new int(42);    return *value;  }private:  int * value;}The if_, through magic of templated types, can now be called with lazy type, and its signature becomes:lazy if_(bool, lazy, lazy);lazy x, y; // no ints instantiatedlazy l = if_(scalar, x, y); // return either x or yparam_type = l.type(); // actually creates an instanceIn original example, same would require this:int x = 10;int y = 20;int value = if_(scalar, x, y);Both values need to be instantiated before or the call.The example above is nonsensical, but makes more sense if instead of ints there were some big and expensive object.   