I would like a type trait common
so that
common<int,int>::type -> int
common<const int, int>::type -> const int
common<int, int &>::type -> int
common<int &, int &>::type -> int &
common<int &, int const &>::type -> int const &
that is the result type should be the more restricted of the two. Is there a trait in the C++11 std that can do this or do I have to roll my own?
Aucun commentaire:
Enregistrer un commentaire