Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/fusion/container/generation/pair_tie.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
rev | line source |
---|---|
Chris@16 | 1 /*============================================================================= |
Chris@16 | 2 Copyright (c) 2001-2011 Joel de Guzman |
Chris@16 | 3 Copyright (c) 2006 Dan Marsden |
Chris@16 | 4 |
Chris@16 | 5 Distributed under the Boost Software License, Version 1.0. (See accompanying |
Chris@16 | 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 7 ==============================================================================*/ |
Chris@16 | 8 #if !defined (BOOST_FUSION_PAIR_TIE_20060812_2058) |
Chris@16 | 9 #define BOOST_FUSION_PAIR_TIE_20060812_2058 |
Chris@16 | 10 |
Chris@16 | 11 #include <boost/type_traits/is_const.hpp> |
Chris@16 | 12 #include <boost/utility/enable_if.hpp> |
Chris@16 | 13 |
Chris@16 | 14 namespace boost { namespace fusion { |
Chris@16 | 15 |
Chris@16 | 16 template<typename Key, typename T> |
Chris@16 | 17 struct pair; |
Chris@16 | 18 |
Chris@16 | 19 namespace result_of |
Chris@16 | 20 { |
Chris@16 | 21 template<typename Key, typename T> |
Chris@16 | 22 struct pair_tie |
Chris@16 | 23 { |
Chris@16 | 24 typedef fusion::pair<Key, T&> type; |
Chris@16 | 25 }; |
Chris@16 | 26 } |
Chris@16 | 27 |
Chris@16 | 28 template<typename Key, typename T> |
Chris@16 | 29 typename disable_if<is_const<T>, typename result_of::pair_tie<Key, T>::type>::type |
Chris@16 | 30 pair_tie(T& t) |
Chris@16 | 31 { |
Chris@16 | 32 return typename result_of::pair_tie<Key, T>::type(t); |
Chris@16 | 33 } |
Chris@16 | 34 |
Chris@16 | 35 template<typename Key, typename T> |
Chris@16 | 36 typename result_of::pair_tie<Key, T const>::type |
Chris@16 | 37 pair_tie(T const& t) |
Chris@16 | 38 { |
Chris@16 | 39 return typename result_of::pair_tie<Key, T const>::type(t); |
Chris@16 | 40 } |
Chris@16 | 41 }} |
Chris@16 | 42 |
Chris@16 | 43 #endif |