identity
eval_ifとかに使う
namespace shand { namespace mpl { template <class Type> struct identity { typedef Type type; }; }} // namespace shand::mpl
#include <iostream> #include <shand/type_traits.hpp> #include <shand/mpl/eval_if.hpp> #include <shand/mpl/identity.hpp> using namespace std; using namespace shand; using namespace shand::mpl; int main() { eval_if<is_integral<int>, identity<int>, identity<char> >::type value; cout << typeid(value).name() << endl; return 0; }