Hacker News new | past | comments | ask | show | jobs | submit login

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: