26 #include <type_traits> 45 template<
typename T >
49 return std::shared_ptr< T >( x, [](
T *){} );
52 template<
typename T >
53 std::shared_ptr< T const >
56 return std::shared_ptr< T const >( x, [](
T const *){} );
59 template<
typename T >
61 shareRaw(
T & c ) -> std::shared_ptr<
typename std::remove_pointer< decltype( c.data() ) >::type >
63 using value_type =
typename std::remove_pointer< decltype( c.data() ) >::type;
64 return std::shared_ptr< value_type >( c.data(), [](value_type *){} );
67 template<
typename T >
69 shareRaw(
T const & c ) -> std::shared_ptr<
typename std::remove_pointer< decltype( c.data() ) >::type >
71 using value_type =
typename std::remove_pointer< decltype( c.data() ) >::type;
72 return std::shared_ptr< value_type >( c.data(), [](value_type *){} );
std::shared_ptr< T > shareRaw(T *x)
Share ownership with a raw pointer.
Definition: ShareRaw.hpp:47
Public definitions of openPMD-api.
Definition: Date.cpp:29