Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T>
- T *factory()
- {
- return new T{};
- }
- int main()
- {
- std::vector<int> *myVectorPointer = factory<std::vector<int>>();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement