SHARE
TWEET

Untitled

a guest Feb 21st, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template <typename T>
  2. T *factory()
  3. {
  4.     return new T{};
  5. }
  6.  
  7. int main()
  8. {
  9.     std::vector<int> *myVectorPointer = factory<std::vector<int>>();
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top