Logo ROOT   6.14/05
Reference Guide
RMakeUnique.hxx
Go to the documentation of this file.
1 /// \file ROOT/RMakeUnique.h
2 /// \ingroup Base StdExt
3 /// \author Danilo Piparo
4 /// \date 2017-09-22
5 
6 /*************************************************************************
7  * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
8  * All rights reserved. *
9  * *
10  * For the licensing terms see $ROOTSYS/LICENSE. *
11  * For the list of contributors see $ROOTSYS/README/CREDITS. *
12  *************************************************************************/
13 
14 #ifndef ROOT_RMakeUnique
15 #define ROOT_RMakeUnique
16 
17 #include <memory>
18 
19 #if __cplusplus < 201402L && !defined(_MSC_VER)
20 
21 #include <utility>
22 
23 namespace std {
24 
25 template <typename T, typename... Args>
26 std::unique_ptr<T> make_unique(Args &&... args)
27 {
28  return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
29 }
30 }
31 #endif
32 
33 #endif
double T(double x)
Definition: ChebyshevPol.h:34
STL namespace.
std::unique_ptr< T > make_unique(Args &&... args)
Definition: RMakeUnique.hxx:26