4 ms·
Why not template<typename T> void my_func(std::vector<T>& vec); ? The reference (or use a pointer, if you want) ensures that derived types can be pas
by aw1621107 6y ago
Why not
template<typename T>
void my_func(std::vector<T>& vec);
?
The reference (or use a pointer, if you want) ensures that derived types can be passed, and the template allows for any parameterization to be used.