]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/property_map/include/boost/property_map/parallel/detail/untracked_pair.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / property_map / include / boost / property_map / parallel / detail / untracked_pair.hpp
CommitLineData
7c673cae
FG
1// Copyright (C) 2007 Matthias Troyer
2//
3// Use, modification and distribution is subject to the Boost Software
4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5//
6// This file contains helper data structures for use in transmitting
7// properties. The basic idea is to optimize away any storage for the
8// properties when no properties are specified.
9#ifndef BOOST_PARALLEL_DETAIL_UNTRACKED_PAIR_HPP
10#define BOOST_PARALLEL_DETAIL_UNTRACKED_PAIR_HPP
11
12#include <boost/mpi/datatype.hpp>
13#include <utility> // for std::pair
14#include <boost/serialization/utility.hpp>
15
16namespace boost { namespace parallel { namespace detail {
17
18/**
19 * This structure is like std::pair, with the only difference
20 * that tracking in the serialization library is turned off.
21 */
22
23template<typename T, typename U>
24struct untracked_pair : public std::pair<T,U>
25{
26 untracked_pair() {}
27
28 untracked_pair(const T& t, const U& u)
29 : std::pair<T,U>(t,u) {}
30
31 template<class T1, class U1>
32 untracked_pair(std::pair<T1,U1> const& p)
33 : std::pair<T,U>(p) {}
34};
35
36template<typename T, typename U>
37inline untracked_pair<T, U>
38make_untracked_pair(const T& t, const U& u)
39{
40 return untracked_pair<T,U>(t,u);
41}
42
43} } } // end namespace boost::parallel::detail
44
45namespace boost { namespace mpi {
46
47template<typename T, typename U>
48struct is_mpi_datatype<boost::parallel::detail::untracked_pair<T, U> >
49 : is_mpi_datatype<std::pair<T,U> > {};
50
51} } // end namespace boost::mpi
52
53namespace boost { namespace serialization {
54
55// pair
56template<class Archive, class F, class S>
57inline void serialize(
58 Archive & ar,
59 boost::parallel::detail::untracked_pair<F, S> & p,
60 const unsigned int /* file_version */
61){
62 ar & boost::serialization::make_nvp("first", p.first);
63 ar & boost::serialization::make_nvp("second", p.second);
64}
65
66template<typename T, typename U>
67struct is_bitwise_serializable<
68 boost::parallel::detail::untracked_pair<T, U> >
69 : is_bitwise_serializable<std::pair<T, U> > {};
70
71template<typename T, typename U>
72struct implementation_level<boost::parallel::detail::untracked_pair<T, U> >
73 : mpl::int_<object_serializable> {} ;
74
75template<typename T, typename U>
76struct tracking_level<boost::parallel::detail::untracked_pair<T, U> >
77 : mpl::int_<track_never> {} ;
78
79} } // end namespace boost::serialization
80
81#endif // BOOST_PARALLEL_DETAIL_UNTRACKED_PAIR_HPP