12#include <boost/type_traits/add_const.hpp>
13#include <boost/type_traits/add_reference.hpp>
57template <
typename T,
bool IsRef>
106 typedef typename boost::add_reference<
107 typename boost::add_const<T>::type
Encapsulate solution for Exercise 2-0.
A unary metafunction that returns T if it is a reference type, and otherwise returns T const&.
The default implementation adds a const& to the template type.
This is a home-grown implementation to the problem.
Boost MPL implementation.
boost::add_reference< typenameboost::add_const< T >::type >::type type