From 7af59eda13eb8dcbb14e6db71266772f5ea663e9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 3 Dec 2016 07:11:02 +0100 Subject: compat: avoid namespace clashes --- compat/make-unique.hpp | 9 +++++---- compat/util.hpp | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'compat') 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 #include -namespace detail { +namespace raii_detail { template struct Unique_if { typedef std::unique_ptr Single_object; @@ -26,18 +26,19 @@ template struct Unique_if } template - typename detail::Unique_if::Single_object + typename ::raii_detail::Unique_if::Single_object make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } template - typename detail::Unique_if::Unknown_bound + typename ::raii_detail::Unique_if::Unknown_bound make_unique(std::size_t n) { typedef typename std::remove_extent::type U; return std::unique_ptr(new U[n]()); } template - typename detail::Unique_if::Known_bound + typename ::raii_detail::Unique_if::Known_bound make_unique(Args&&...) = delete; + diff --git a/compat/util.hpp b/compat/util.hpp index 7a6858a3..a63e245f 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -22,7 +22,7 @@ int iround(const t& val) return int(std::round(val)); } -namespace detail { +namespace util_detail { template inline auto clamp_(n val, n min, n max) -> n @@ -39,5 +39,5 @@ inline auto clamp_(n val, n min, n max) -> n template inline auto clamp(const t& val, const u& min, const w& max) -> decltype(val * min * max) { - return ::detail::clamp_(val, min, max); + return ::util_detail::clamp_(val, min, max); } -- cgit v1.2.3