Caffe2 - C++ API
A deep learning, cross platform ML framework
Pointer.h
1 //===- nomnigraph/Support/Pointer.h - Smart pointer helpers -----*- C++ -*-===//
2 //
3 // TODO Licensing.
4 //
5 //===----------------------------------------------------------------------===//
6 //
7 // This file defines a C++11 compatible make_unique
8 //
9 //===----------------------------------------------------------------------===//
10 
11 #ifndef NOM_SUPPORT_POINTER_H
12 #define NOM_SUPPORT_POINTER_H
13 
14 #include <memory>
15 
16 namespace nom {
17 namespace util {
18 
19 template <typename T, typename... Args>
20 std::unique_ptr<T> make_unique(Args &&... args) {
21  return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
22 }
23 
24 } // namespace util
25 } // namespace nom
26 
27 #endif // NOM_SUPPORT_POINTER_H
Definition: Caffe2.cc:16