1 #ifndef BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_HPP
2 #define BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // archive_input_unordered_set.hpp
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)
18 // See http://www.boost.org for updates, documentation, and revision history.
21 namespace serialization {
25 // unordered_set input
26 template<class Archive, class Container>
27 struct archive_input_unordered_set
29 inline void operator()(
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());
42 s.emplace(t.reference());
45 ar.reset_object_address(& (* result.first), & t.reference());
49 // unordered_multiset input
50 template<class Archive, class Container>
51 struct archive_input_unordered_multiset
53 inline void operator()(
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());
65 s.emplace(t.reference());
67 ar.reset_object_address(& (* result), & t.reference());
75 #endif // BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_HPP