Brian Silverman | fad8f55 | 2018-08-04 23:36:19 -0700 | [diff] [blame^] | 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_FLAT_MAP_HPP |
| 12 | #define BOOST_CONTAINER_PMR_FLAT_MAP_HPP |
| 13 | |
| 14 | #if defined (_MSC_VER) |
| 15 | # pragma once |
| 16 | #endif |
| 17 | |
| 18 | #include <boost/container/flat_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 | using flat_map = boost::container::flat_map<Key, T, Compare, polymorphic_allocator<std::pair<Key, T> > >; |
| 31 | |
| 32 | template <class Key |
| 33 | ,class T |
| 34 | ,class Compare = std::less<Key> > |
| 35 | using flat_multimap = boost::container::flat_multimap<Key, T, Compare, polymorphic_allocator<std::pair<Key, T> > >; |
| 36 | |
| 37 | #endif |
| 38 | |
| 39 | //! A portable metafunction to obtain a flat_map |
| 40 | //! that uses a polymorphic allocator |
| 41 | template <class Key |
| 42 | ,class T |
| 43 | ,class Compare = std::less<Key> > |
| 44 | struct flat_map_of |
| 45 | { |
| 46 | typedef boost::container::flat_map<Key, T, Compare, polymorphic_allocator<std::pair<Key, T> > > type; |
| 47 | }; |
| 48 | |
| 49 | //! A portable metafunction to obtain a flat_multimap |
| 50 | //! that uses a polymorphic allocator |
| 51 | template <class Key |
| 52 | ,class T |
| 53 | ,class Compare = std::less<Key> > |
| 54 | struct flat_multimap_of |
| 55 | { |
| 56 | typedef boost::container::flat_multimap<Key, T, Compare, polymorphic_allocator<std::pair<Key, T> > > type; |
| 57 | }; |
| 58 | |
| 59 | } //namespace pmr { |
| 60 | } //namespace container { |
| 61 | } //namespace boost { |
| 62 | |
| 63 | #endif //BOOST_CONTAINER_PMR_FLAT_MAP_HPP |