]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/fusion/include/boost/fusion/container/generation/pair_tie.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / fusion / include / boost / fusion / container / generation / pair_tie.hpp
CommitLineData
7c673cae
FG
1/*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2006 Dan Marsden
4
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7==============================================================================*/
8#if !defined (BOOST_FUSION_PAIR_TIE_20060812_2058)
9#define BOOST_FUSION_PAIR_TIE_20060812_2058
10
11#include <boost/fusion/support/config.hpp>
12#include <boost/type_traits/is_const.hpp>
13#include <boost/utility/enable_if.hpp>
14
15namespace boost { namespace fusion {
16
17 template<typename Key, typename T>
18 struct pair;
19
20 namespace result_of
21 {
22 template<typename Key, typename T>
23 struct pair_tie
24 {
25 typedef fusion::pair<Key, T&> type;
26 };
27 }
28
29 template<typename Key, typename T>
30 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
31 typename disable_if<is_const<T>, typename result_of::pair_tie<Key, T>::type>::type
32 pair_tie(T& t)
33 {
34 return typename result_of::pair_tie<Key, T>::type(t);
35 }
36
37 template<typename Key, typename T>
38 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
39 typename result_of::pair_tie<Key, T const>::type
40 pair_tie(T const& t)
41 {
42 return typename result_of::pair_tie<Key, T const>::type(t);
43 }
44}}
45
46#endif