3#ifndef DUNE_COMMON_STD_MEMORY_HH
4#define DUNE_COMMON_STD_MEMORY_HH
20 struct MakeUniqueHelper
22 typedef std::unique_ptr<T> NonArrayUniquePtr;
26 struct MakeUniqueHelper<T[]>
28 typedef std::unique_ptr<T[]> UnknownBoundArrayUniquePtr;
32 template<
class T,
size_t N>
33 struct MakeUniqueHelper<T[N]>
35 typedef void KnownBoundArrayUniquePtr;
49 template<
typename T,
typename... Args>
50 typename MakeUniqueHelper<T>::NonArrayUniquePtr
51 make_unique(Args&&... args)
53 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
63 typename MakeUniqueHelper<T>::UnknownBoundArrayUniquePtr
66 return std::unique_ptr<T>(
new typename MakeUniqueHelper<T>::RawType[n]());
79 template<
typename T,
typename ...Args>
80 typename MakeUniqueHelper<T>::KnownBoundArrayUniquePtr
81 make_unique(Args&&... args) =
delete;
Dune namespace.
Definition: alignment.hh:10