diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-12-03 07:11:02 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-12-03 07:11:02 +0100 |
commit | 7af59eda13eb8dcbb14e6db71266772f5ea663e9 (patch) | |
tree | 9ec2aa93b59475c42c7e306ac8e438fff27669f2 /compat/make-unique.hpp | |
parent | 388be5f883425419ed2e8362ed425a86839aa162 (diff) |
compat: avoid namespace clashes
Diffstat (limited to 'compat/make-unique.hpp')
-rw-r--r-- | compat/make-unique.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compat/make-unique.hpp b/compat/make-unique.hpp index bb5315c5..64c647b1 100644 --- a/compat/make-unique.hpp +++ b/compat/make-unique.hpp @@ -8,7 +8,7 @@ #include <utility> #include <cstddef> -namespace detail { +namespace raii_detail { template<class T> struct Unique_if { typedef std::unique_ptr<T> Single_object; @@ -26,18 +26,19 @@ template<class T, size_t N> struct Unique_if<T[N]> } template<class T, class... Args> - typename detail::Unique_if<T>::Single_object + typename ::raii_detail::Unique_if<T>::Single_object make_unique(Args&&... args) { return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); } template<class T> - typename detail::Unique_if<T>::Unknown_bound + typename ::raii_detail::Unique_if<T>::Unknown_bound make_unique(std::size_t n) { typedef typename std::remove_extent<T>::type U; return std::unique_ptr<T>(new U[n]()); } template<class T, class... Args> - typename detail::Unique_if<T>::Known_bound + typename ::raii_detail::Unique_if<T>::Known_bound make_unique(Args&&...) = delete; + |