]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/serialization/include/boost/serialization/archive_input_unordered_set.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / serialization / include / boost / serialization / archive_input_unordered_set.hpp
1 #ifndef BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_HPP
2 #define BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_HPP
3
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
6 # pragma once
7 #endif
8
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // archive_input_unordered_set.hpp
11
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // (C) Copyright 2014 Jim Bell
14 // Use, modification and distribution is subject to the Boost Software
15 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
17
18 // See http://www.boost.org for updates, documentation, and revision history.
19
20 namespace boost {
21 namespace serialization {
22
23 namespace stl {
24
25 // unordered_set input
26 template<class Archive, class Container>
27 struct archive_input_unordered_set
28 {
29 inline void operator()(
30 Archive &ar,
31 Container &s,
32 const unsigned int v
33 ){
34 typedef typename Container::value_type type;
35 detail::stack_construct<Archive, type> t(ar, v);
36 // borland fails silently w/o full namespace
37 ar >> boost::serialization::make_nvp("item", t.reference());
38 std::pair<typename Container::const_iterator, bool> result =
39 #ifdef BOOST_NO_CXX11_HDR_UNORDERED_SET
40 s.insert(t.reference());
41 #else
42 s.emplace(t.reference());
43 #endif
44 if(result.second)
45 ar.reset_object_address(& (* result.first), & t.reference());
46 }
47 };
48
49 // unordered_multiset input
50 template<class Archive, class Container>
51 struct archive_input_unordered_multiset
52 {
53 inline void operator()(
54 Archive &ar,
55 Container &s,
56 const unsigned int v
57 ){
58 typedef typename Container::value_type type;
59 detail::stack_construct<Archive, type> t(ar, v);
60 ar >> boost::serialization::make_nvp("item", t.reference());
61 typename Container::const_iterator result =
62 #ifdef BOOST_NO_CXX11_HDR_UNORDERED_SET
63 s.insert(t.reference());
64 #else
65 s.emplace(t.reference());
66 #endif
67 ar.reset_object_address(& (* result), & t.reference());
68 }
69 };
70
71 } // stl
72 } // serialization
73 } // boost
74
75 #endif // BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_HPP