lundi 6 avril 2015

how to use C++11 integral_constant::value_type()

I am learning to use C++ 11 type_traits, in integral_constant, there is a function value_type();


I tried this but got error:



typedef std::integral_constant<int, 1> one_t;
one_t one_o;
one_o.value_type();



../src/main.cc:13:9: error: cannot refer to type member 'value_type' in 'one_t' (aka 'integral_constant') with '.'

one_o.value_type();



Aucun commentaire:

Enregistrer un commentaire