From f9658f69a49543e03ae2f5c779d77e3a17b49a53 Mon Sep 17 00:00:00 2001 From: mkrzewic Date: Tue, 30 Oct 2018 14:56:48 +0100 Subject: [PATCH] Alias boost::container::pmr -> fair::mq::pmr so the eventual switch to std::pmr becomes easier --- fairmq/MemoryResourceTools.h | 4 ++-- fairmq/MemoryResources.h | 5 +++-- test/memory_resources/_memory_resources.cxx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fairmq/MemoryResourceTools.h b/fairmq/MemoryResourceTools.h index d32fe2fa..fefab59b 100644 --- a/fairmq/MemoryResourceTools.h +++ b/fairmq/MemoryResourceTools.h @@ -18,14 +18,14 @@ namespace fair { namespace mq { -using BytePmrAllocator = boost::container::pmr::polymorphic_allocator; +using BytePmrAllocator = pmr::polymorphic_allocator; //_________________________________________________________________________________________________ // return the message associated with the container or throw if it is not possible template // typename std::enable_if< // std::is_base_of< -// boost::container::pmr::polymorphic_allocator, // typename ContainerT::allocator_type>::value == true, // FairMQMessagePtr>::type diff --git a/fairmq/MemoryResources.h b/fairmq/MemoryResources.h index 816aa451..9a4c93c7 100644 --- a/fairmq/MemoryResources.h +++ b/fairmq/MemoryResources.h @@ -33,11 +33,12 @@ namespace fair { namespace mq { using byte = unsigned char; +namespace pmr = boost::container::pmr; /// All FairMQ related memory resources need to inherit from this interface /// class for the /// getMessage() api. -class FairMQMemoryResource : public boost::container::pmr::memory_resource +class FairMQMemoryResource : public pmr::memory_resource { public: /// return the message containing data associated with the pointer (to start @@ -103,7 +104,7 @@ class ChannelResource : public FairMQMemoryResource messageMap.erase(p); }; - bool do_is_equal(const boost::container::pmr::memory_resource &other) const noexcept override + bool do_is_equal(const pmr::memory_resource &other) const noexcept override { return this == &other; }; diff --git a/test/memory_resources/_memory_resources.cxx b/test/memory_resources/_memory_resources.cxx index 88087992..d01adddc 100644 --- a/test/memory_resources/_memory_resources.cxx +++ b/test/memory_resources/_memory_resources.cxx @@ -71,7 +71,7 @@ TEST(MemoryResources, transportallocatormap_test) EXPECT_TRUE(_tmp == allocZMQ); } -using namespace boost::container::pmr; +using namespace fair::mq::pmr; TEST(MemoryResources, allocator_test) {