Version: SMASH-2.2
cxx14compat.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2021
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_CXX14COMPAT_H_
11 #define SRC_INCLUDE_SMASH_CXX14COMPAT_H_
12 
13 #include <memory>
14 #include <utility>
15 
16 namespace smash {
17 
24 #if __cplusplus < 201402L
25 template <typename T, typename... Args>
26 inline std::unique_ptr<T> make_unique(Args &&... args) {
27  return std::unique_ptr<T>{new T{std::forward<Args>(args)...}};
28 }
29 #else
30 using std::make_unique;
31 #endif
32 } // namespace smash
33 
34 #endif // SRC_INCLUDE_SMASH_CXX14COMPAT_H_
Definition: action.h:24
std::unique_ptr< T > make_unique(Args &&... args)
Definition for make_unique Is in C++14's standard library; necessary for older compilers.
Definition: cxx14compat.h:26