I'm using template aliases like so:
template <typename T, typename = typename std::enable_if<std::is_floating_point<T>::value>::type>
using vec2 = std::pair<T, T>;
template <typename T, typename = typename std::enable_if<std::is_floating_point<T>::value>::type>
using vec3 = std::tuple<T, T, T>;
The problem is anyone can subvert this by doing vec2<int, any_type>
. How do I prevent this?
Aucun commentaire:
Enregistrer un commentaire