mercredi 4 mars 2015

How to automatically deduce T in this forwarding function?


Given this code



template <typename T, typename... Args>
auto make_vector(Args&&... args)
{
return std::vector<T>{std::forward<Args>(args)...};
}


I don't want to type make_vector<int>(1, 2, 3, 4). How to get rid of T?




Aucun commentaire:

Enregistrer un commentaire