// BoostContainerPmrCompilationError.cpp : // minimal file to reproduce compilation error while using // boost 1.63.0 boost::container::pmr::polymorphic_allocator // with boost::container::map, std::map, std::unordered_map // #include #include #if 1 #include namespace pmr = boost::container::pmr; int main() { using KeyType = size_t; pmr::unsynchronized_pool_resource memoryResource; pmr::polymorphic_allocator> myAllocator(&memoryResource); boost::container::map , pmr::polymorphic_allocator > > myMap(myAllocator); myMap.try_emplace(static_cast(1), static_cast(1)); return 0; } #elif 0 #include namespace pmr = boost::container::pmr; int main() { using KeyType = size_t; pmr::unsynchronized_pool_resource memoryResource; pmr::polymorphic_allocator> myAllocator(&memoryResource); std::map , pmr::polymorphic_allocator > > myMap(myAllocator); myMap.try_emplace(static_cast(1), static_cast(1)); return 0; } #else #include namespace pmr = boost::container::pmr; int main() { using KeyType = size_t; pmr::unsynchronized_pool_resource memoryResource; boost::unordered_map, std::equal_to, pmr::polymorphic_allocator > > myHashMap(10, std::hash(), std::equal_to(), pmr::polymorphic_allocator >( &memoryResource ) ); myHashMap.emplace(static_cast(1), static_cast(1)); return 0; } #endif