371cf9c792b8c3986557cf5725ad0fb23d91cb4e
[libcds.git] / cds / container / striped_map / boost_map.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_CONTAINER_STRIPED_MAP_BOOST_MAP_ADAPTER_H
4 #define __CDS_CONTAINER_STRIPED_MAP_BOOST_MAP_ADAPTER_H
5
6 #include <boost/version.hpp>
7 #if BOOST_VERSION < 104800
8 #   error "For boost::container::map you must use boost 1.48 or above"
9 #endif
10
11 #include <cds/container/striped_set/adapter.h>
12 #include <boost/container/map.hpp>
13
14 //@cond
15 namespace cds { namespace container {
16     namespace striped_set {
17
18         // Copy policy for map
19         template <typename Key, typename T, typename Traits, typename Alloc>
20         struct copy_item_policy< boost::container::map< Key, T, Traits, Alloc > >
21             : public details::boost_map_copy_policies<boost::container::map< Key, T, Traits, Alloc > >::copy_item_policy
22         {};
23
24         // Swap item policy
25         template <typename Key, typename T, typename Traits, typename Alloc>
26         struct swap_item_policy< boost::container::map< Key, T, Traits, Alloc > >
27             : public details::boost_map_copy_policies<boost::container::map< Key, T, Traits, Alloc > >::swap_item_policy
28         {};
29
30 #ifdef CDS_MOVE_SEMANTICS_SUPPORT
31         // Move policy for map
32         template <typename Key, typename T, typename Traits, typename Alloc>
33         struct move_item_policy< boost::container::map< Key, T, Traits, Alloc > >
34             : public details::boost_map_copy_policies<boost::container::map< Key, T, Traits, Alloc > >::move_item_policy
35         {};
36 #endif
37     }   // namespace striped_set
38 }} // namespace cds::container
39
40 namespace cds { namespace intrusive { namespace striped_set {
41
42     /// std::set adapter for hash set bucket
43     template <typename Key, typename T, class Traits, class Alloc, CDS_SPEC_OPTIONS>
44     class adapt< boost::container::map< Key, T, Traits, Alloc>, CDS_OPTIONS >
45     {
46     public:
47         typedef boost::container::map< Key, T, Traits, Alloc>     container_type          ;   ///< underlying container type
48         typedef cds::container::striped_set::details::boost_map_adapter< container_type, CDS_OPTIONS >    type;
49     };
50 }}} // namespace cds::intrusive::striped_set
51
52 //@endcond
53
54 #endif // #ifndef __CDS_CONTAINER_STRIPED_MAP_BOOST_MAP_ADAPTER_H