1 ////////////////////////////////////////////////////////////////////////////// 2 // 3 // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost 4 // Software License, Version 1.0. (See accompanying file 5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 // 7 // See http://www.boost.org/libs/container for documentation. 8 // 9 ////////////////////////////////////////////////////////////////////////////// 10 11 #ifndef BOOST_CONTAINER_PMR_MAP_HPP 12 #define BOOST_CONTAINER_PMR_MAP_HPP 13 14 #if defined (_MSC_VER) 15 # pragma once 16 #endif 17 18 #include <boost/container/map.hpp> 19 #include <boost/container/pmr/polymorphic_allocator.hpp> 20 21 namespace boost { 22 namespace container { 23 namespace pmr { 24 25 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) 26 27 template <class Key 28 ,class T 29 ,class Compare = std::less<Key> 30 ,class Options = void > 31 using map = boost::container::map<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options>; 32 33 template <class Key 34 ,class T 35 ,class Compare = std::less<Key> 36 ,class Options = void > 37 using multimap = boost::container::multimap<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options>; 38 39 #endif 40 41 //! A portable metafunction to obtain a map 42 //! that uses a polymorphic allocator 43 template <class Key 44 ,class T 45 ,class Compare = std::less<Key> 46 ,class Options = void > 47 struct map_of 48 { 49 typedef boost::container::map<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options> type; 50 }; 51 52 //! A portable metafunction to obtain a multimap 53 //! that uses a polymorphic allocator 54 template <class Key 55 ,class T 56 ,class Compare = std::less<Key> 57 ,class Options = void > 58 struct multimap_of 59 { 60 typedef boost::container::multimap<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options> type; 61 }; 62 63 } //namespace pmr { 64 } //namespace container { 65 } //namespace boost { 66 67 #endif //BOOST_CONTAINER_PMR_MAP_HPP 68