Chris@102
|
1 //////////////////////////////////////////////////////////////////////////////
|
Chris@102
|
2 //
|
Chris@102
|
3 // (C) Copyright Ion Gaztanaga 2014-2015. Distributed under the Boost
|
Chris@102
|
4 // Software License, Version 1.0. (See accompanying file
|
Chris@102
|
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@102
|
6 //
|
Chris@102
|
7 // See http://www.boost.org/libs/container for documentation.
|
Chris@102
|
8 //
|
Chris@102
|
9 //////////////////////////////////////////////////////////////////////////////
|
Chris@102
|
10 #ifndef BOOST_CONTAINER_DETAIL_ALLOC_TRAITS_HPP
|
Chris@102
|
11 #define BOOST_CONTAINER_DETAIL_ALLOC_TRAITS_HPP
|
Chris@102
|
12
|
Chris@102
|
13 #ifndef BOOST_CONFIG_HPP
|
Chris@102
|
14 # include <boost/config.hpp>
|
Chris@102
|
15 #endif
|
Chris@102
|
16
|
Chris@102
|
17 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@102
|
18 # pragma once
|
Chris@102
|
19 #endif
|
Chris@102
|
20
|
Chris@102
|
21 // move
|
Chris@102
|
22 #include <boost/move/adl_move_swap.hpp>
|
Chris@102
|
23 #include <boost/move/utility_core.hpp>
|
Chris@102
|
24
|
Chris@102
|
25 namespace boost {
|
Chris@102
|
26 namespace container {
|
Chris@102
|
27 namespace container_detail {
|
Chris@102
|
28
|
Chris@102
|
29 template<class AllocatorType>
|
Chris@102
|
30 inline void swap_alloc(AllocatorType &, AllocatorType &, container_detail::false_type)
|
Chris@102
|
31 BOOST_NOEXCEPT_OR_NOTHROW
|
Chris@102
|
32 {}
|
Chris@102
|
33
|
Chris@102
|
34 template<class AllocatorType>
|
Chris@102
|
35 inline void swap_alloc(AllocatorType &l, AllocatorType &r, container_detail::true_type)
|
Chris@102
|
36 { boost::adl_move_swap(l, r); }
|
Chris@102
|
37
|
Chris@102
|
38 template<class AllocatorType>
|
Chris@102
|
39 inline void assign_alloc(AllocatorType &, const AllocatorType &, container_detail::false_type)
|
Chris@102
|
40 BOOST_NOEXCEPT_OR_NOTHROW
|
Chris@102
|
41 {}
|
Chris@102
|
42
|
Chris@102
|
43 template<class AllocatorType>
|
Chris@102
|
44 inline void assign_alloc(AllocatorType &l, const AllocatorType &r, container_detail::true_type)
|
Chris@102
|
45 { l = r; }
|
Chris@102
|
46
|
Chris@102
|
47 template<class AllocatorType>
|
Chris@102
|
48 inline void move_alloc(AllocatorType &, AllocatorType &, container_detail::false_type)
|
Chris@102
|
49 BOOST_NOEXCEPT_OR_NOTHROW
|
Chris@102
|
50 {}
|
Chris@102
|
51
|
Chris@102
|
52 template<class AllocatorType>
|
Chris@102
|
53 inline void move_alloc(AllocatorType &l, AllocatorType &r, container_detail::true_type)
|
Chris@102
|
54 { l = ::boost::move(r); }
|
Chris@102
|
55
|
Chris@102
|
56 } //namespace container_detail {
|
Chris@102
|
57 } //namespace container {
|
Chris@102
|
58 } //namespace boost {
|
Chris@102
|
59
|
Chris@102
|
60 #endif //#ifndef BOOST_CONTAINER_DETAIL_ALLOC_TRAITS_HPP
|