d1d88403c91aa863bc8eccb5b9057c8e3679e625
[libcds.git] / cds / container / striped_set / boost_flat_set.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_CONTAINER_STRIPED_SET_BOOST_FLAT_SET_ADAPTER_H
4 #define __CDS_CONTAINER_STRIPED_SET_BOOST_FLAT_SET_ADAPTER_H
5
6 #include <boost/version.hpp>
7 #if BOOST_VERSION < 104800
8 #   error "For boost::container::flat_set you must use boost 1.48 or above"
9 #endif
10
11 #include <cds/container/striped_set/adapter.h>
12 #include <boost/container/flat_set.hpp>
13
14 //#if CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION >= 1700
15 //#   error "boost::container::flat_set is not compatible with MS VC++ 11"
16 //#endif
17
18 //@cond
19 namespace cds { namespace container {
20     namespace striped_set {
21
22         // Copy policy for boost::container::flat_set
23         template <typename T, typename Traits, typename Alloc>
24         struct copy_item_policy< boost::container::flat_set< T, Traits, Alloc > >
25             : public details::boost_set_copy_policies< boost::container::flat_set< T, Traits, Alloc > >::copy_item_policy
26         {};
27
28         // Swap policy is not defined for boost::container::flat_set
29         template <typename T, typename Traits, typename Alloc>
30         struct swap_item_policy< boost::container::flat_set< T, Traits, Alloc > >
31             : public details::boost_set_copy_policies< boost::container::flat_set< T, Traits, Alloc > >::swap_item_policy
32         {};
33
34 #ifdef CDS_MOVE_SEMANTICS_SUPPORT
35         // Move policy for boost::container::flat_set
36         template <typename T, typename Traits, typename Alloc>
37         struct move_item_policy< boost::container::flat_set< T, Traits, Alloc > >
38             : public details::boost_set_copy_policies< boost::container::flat_set< T, Traits, Alloc > >::move_item_policy
39         {};
40 #endif
41
42     }   // namespace striped_set
43 }} // namespace cds::container
44
45 namespace cds { namespace intrusive { namespace striped_set {
46     template <typename T, class Traits, class Alloc, CDS_SPEC_OPTIONS>
47     class adapt< boost::container::flat_set<T, Traits, Alloc>, CDS_OPTIONS >
48     {
49     public:
50         typedef boost::container::flat_set<T, Traits, Alloc>    container_type ;   ///< underlying container type
51         typedef cds::container::striped_set::details::boost_set_adapter< container_type, CDS_OPTIONS >    type;
52     };
53 }}}
54
55 //@endcond
56
57 #endif // #ifndef __CDS_CONTAINER_STRIPED_SET_BOOST_FLAT_SET_ADAPTER_H