make_unique.h 314 B

1234567891011121314151617
  1. #ifndef _MAKE_UNIQUE_
  2. #define _MAKE_UNIQUE_
  3. #include <memory>
  4. #ifndef _MSC_VER
  5. namespace std
  6. {
  7. template<typename T, typename ...Args>
  8. std::unique_ptr<T> make_unique( Args&& ...args )
  9. {
  10. return std::unique_ptr<T>( new T( std::forward<Args>(args)... ) );
  11. }
  12. }
  13. #endif
  14. #endif // _MAKE_UNIQUE_