]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Boost.Assign library |
2 | // | |
3 | // Copyright Thorsten Ottosen 2003-2004. Use, modification and | |
4 | // distribution is subject to the Boost Software License, Version | |
5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
6 | // http://www.boost.org/LICENSE_1_0.txt) | |
7 | // | |
8 | // For more information, see http://www.boost.org/libs/assign/ | |
9 | // | |
10 | ||
11 | ||
12 | #ifndef BOOST_ASSIGN_STD_QUEUE_HPP | |
13 | #define BOOST_ASSIGN_STD_QUEUE_HPP | |
14 | ||
15 | #if defined(_MSC_VER) | |
16 | # pragma once | |
17 | #endif | |
18 | ||
19 | #include <boost/assign/list_inserter.hpp> | |
20 | #include <boost/config.hpp> | |
92f5a8d4 | 21 | #include <boost/move/utility.hpp> |
7c673cae FG |
22 | #include <queue> |
23 | ||
24 | namespace boost | |
25 | { | |
26 | namespace assign | |
27 | { | |
92f5a8d4 | 28 | #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) |
7c673cae FG |
29 | |
30 | template< class V, class C, class V2 > | |
31 | inline list_inserter< assign_detail::call_push< std::queue<V,C> >, V > | |
32 | operator+=( std::queue<V,C>& c, V2 v ) | |
33 | { | |
34 | return push( c )( v ); | |
35 | } | |
36 | ||
37 | template< class V, class C, class V2 > | |
38 | inline list_inserter< assign_detail::call_push< std::priority_queue<V,C> >, V > | |
39 | operator+=( std::priority_queue<V,C>& c, V2 v ) | |
40 | { | |
41 | return push( c )( v ); | |
42 | } | |
43 | ||
92f5a8d4 TL |
44 | #else |
45 | ||
46 | template< class V, class C, class V2 > | |
47 | inline list_inserter< assign_detail::call_push< std::queue<V, C> >, V > | |
48 | operator+=(std::queue<V, C>& c, V2&& v) | |
49 | { | |
50 | return push(c)(boost::forward<V2>(v)); | |
51 | } | |
52 | ||
53 | template< class V, class C, class V2 > | |
54 | inline list_inserter< assign_detail::call_push< std::priority_queue<V, C> >, V > | |
55 | operator+=(std::priority_queue<V, C>& c, V2&& v) | |
56 | { | |
57 | return push(c)(boost::forward<V2>(v)); | |
58 | } | |
59 | ||
60 | #endif | |
7c673cae FG |
61 | } |
62 | } | |
63 | ||
64 | #endif |