From e7bf2330ed6b0012824c4dd42e5095771f0c49a1 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 10 Oct 2016 17:58:59 +1100 Subject: [PATCH] alloc: use nested namespace decl --- alloc/affix.hpp | 4 ++-- alloc/allocator.hpp | 4 ++-- alloc/arena.hpp | 4 ++-- alloc/dynamic.hpp | 4 ++-- alloc/fallback.hpp | 4 ++-- alloc/fwd.hpp | 4 ++-- alloc/linear.hpp | 4 ++-- alloc/malloc.hpp | 4 ++-- alloc/null.hpp | 4 ++-- alloc/stack.hpp | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/alloc/affix.hpp b/alloc/affix.hpp index 6cbf3602..f3042c60 100644 --- a/alloc/affix.hpp +++ b/alloc/affix.hpp @@ -19,13 +19,13 @@ #include -namespace util { namespace alloc { +namespace util::alloc { template class affix { void* allocate (size_t bytes, size_t align = alignof (std::max_align_t)); void deallocate (void *ptr, size_t bytes, size_t align = alignof (std::max_align_t)); }; -} } +} #include "./affix.hpp" diff --git a/alloc/allocator.hpp b/alloc/allocator.hpp index 18c160ce..efb302d9 100644 --- a/alloc/allocator.hpp +++ b/alloc/allocator.hpp @@ -21,7 +21,7 @@ // C++11 allocator concept conformant allocator adaptor, going from our // allocator interface to that of the STL and friends. -namespace util { namespace alloc { +namespace util::alloc { template class allocator { public: @@ -36,7 +36,7 @@ namespace util { namespace alloc { private: B &m_backing; }; -} } +} #include "./allocator.ipp" diff --git a/alloc/arena.hpp b/alloc/arena.hpp index 737c9cc0..82423844 100644 --- a/alloc/arena.hpp +++ b/alloc/arena.hpp @@ -22,7 +22,7 @@ #include #include -namespace util { namespace alloc { +namespace util::alloc { template class arena { public: @@ -64,7 +64,7 @@ namespace util { namespace alloc { private: T &m_store; }; -} } +} #include "./arena.ipp" diff --git a/alloc/dynamic.hpp b/alloc/dynamic.hpp index 7d5fd689..1fafb5df 100644 --- a/alloc/dynamic.hpp +++ b/alloc/dynamic.hpp @@ -20,7 +20,7 @@ #include #include -namespace util { namespace alloc { +namespace util::alloc { // wraps an allocator given at construction time, forwarding all calls to // the inner object. used to allow virtual dispatch of the non-virtual // allocator interface. @@ -172,6 +172,6 @@ namespace util { namespace alloc { std::unique_ptr m_child; }; -} } +} #endif diff --git a/alloc/fallback.hpp b/alloc/fallback.hpp index f9f1efab..ea507123 100644 --- a/alloc/fallback.hpp +++ b/alloc/fallback.hpp @@ -19,7 +19,7 @@ #include -namespace util { namespace alloc { +namespace util::alloc { template class fallback { public: @@ -28,6 +28,6 @@ namespace util { namespace alloc { void* allocate (size_t bytes, size_t align = alignof (std::max_align_t)); void deallocate (void *ptr, size_t bytes, size_t align = alignof (std::max_align_t)); }; -} } +} #endif diff --git a/alloc/fwd.hpp b/alloc/fwd.hpp index ed883313..47386524 100644 --- a/alloc/fwd.hpp +++ b/alloc/fwd.hpp @@ -18,7 +18,7 @@ #define __UTIL_ALLOC_FWD_HPP -namespace util { namespace alloc { +namespace util::alloc { class affix; class dynamic; class fallback; @@ -29,6 +29,6 @@ namespace util { namespace alloc { template class arena; template class allocator; -} } +} #endif diff --git a/alloc/linear.hpp b/alloc/linear.hpp index 044e35b5..e63ce254 100644 --- a/alloc/linear.hpp +++ b/alloc/linear.hpp @@ -19,7 +19,7 @@ #include -namespace util { namespace alloc { +namespace util::alloc { // allocate progressively across a buffer without concern for deallocation. // deallocation is a noop; the only way to free allocations is via reset. class linear { @@ -45,7 +45,7 @@ namespace util { namespace alloc { protected: char *m_begin, *m_end, *m_cursor; }; -} } +} #include "./linear.hpp" diff --git a/alloc/malloc.hpp b/alloc/malloc.hpp index bd6e7c6d..caa57e12 100644 --- a/alloc/malloc.hpp +++ b/alloc/malloc.hpp @@ -20,13 +20,13 @@ #include -namespace util { namespace alloc { +namespace util::alloc { class malloc { public: void* allocate (size_t bytes, size_t align = alignof (std::max_align_t)); void deallocate (void *ptr, size_t bytes, size_t align = alignof (std::max_align_t)); }; -} } +} #endif diff --git a/alloc/null.hpp b/alloc/null.hpp index c5e02b36..234e1344 100644 --- a/alloc/null.hpp +++ b/alloc/null.hpp @@ -20,7 +20,7 @@ #include -namespace util { namespace alloc { +namespace util::alloc { // allocator that always fails, throwing bad_alloc. deallocate will // succeed with nullptr as with delete, but is undefined with other values // (it is likely to at least assert). @@ -38,6 +38,6 @@ namespace util { namespace alloc { constexpr size_t used (void) const { return 0u; } constexpr size_t remain (void) const { return 0u; } }; -} } +} #endif diff --git a/alloc/stack.hpp b/alloc/stack.hpp index 294868f4..beef76df 100644 --- a/alloc/stack.hpp +++ b/alloc/stack.hpp @@ -21,7 +21,7 @@ #include -namespace util { namespace alloc { +namespace util::alloc { // allocate memory from a buffer in a stacklike manner. deallocation that // is not correctly ordered has undefined (read 'bad') results. class stack { @@ -48,6 +48,6 @@ namespace util { namespace alloc { private: char *m_begin, *m_end, *m_cursor; }; -} } +} #endif