Silicium
to_shared.hpp
Go to the documentation of this file.
1 #ifndef SILICIUM_TO_SHARED_HPP
2 #define SILICIUM_TO_SHARED_HPP
3 
4 #include <silicium/config.hpp>
5 #include <memory>
6 
7 namespace Si
8 {
9  template <class T>
10  auto to_shared(T &&t)
11 #if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
12  -> std::shared_ptr<typename std::decay<T>::type>
13 #endif
14  {
15  typedef typename std::decay<T>::type decayed_T;
16  return std::make_shared<decayed_T>(std::forward<T>(t));
17  }
18 }
19 
20 #endif
auto to_shared(T &&t) -> std::shared_ptr< typename std::decay< T >::type >
Definition: to_shared.hpp:10
Definition: absolute_path.hpp:19