3#ifndef DUNE_COMMON_STD_MEMORY_HH
4#define DUNE_COMMON_STD_MEMORY_HH
15#if DUNE_HAVE_CXX_MAKE_UNIQUE
30 struct MakeUniqueHelper
32 typedef std::unique_ptr<T> NonArrayUniquePtr;
36 struct MakeUniqueHelper<T[]>
38 typedef std::unique_ptr<T[]> UnknownBoundArrayUniquePtr;
42 template<
class T,
size_t N>
43 struct MakeUniqueHelper<T[N]>
45 typedef void KnownBoundArrayUniquePtr;
64 template<
typename T,
typename... Args>
65 typename Impl::MakeUniqueHelper<T>::NonArrayUniquePtr
68 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
80 typename Impl::MakeUniqueHelper<T>::UnknownBoundArrayUniquePtr
83 return std::unique_ptr<T>(
new typename Impl::MakeUniqueHelper<T>::RawType[n]());
98 template<
typename T,
typename ...Args>
99 typename Impl::MakeUniqueHelper<T>::KnownBoundArrayUniquePtr
Impl::MakeUniqueHelper< T >::KnownBoundArrayUniquePtr make_unique(Args &&... args)=delete
Implementation of std::make_unique to be introduced in C++14.
Definition: memory.hh:66
Dune namespace.
Definition: alignedallocator.hh:10