annotate DEPENDENCIES/generic/include/boost/fusion/sequence/intrinsic/value_at_key.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(FUSION_VALUE_AT_KEY_05052005_0229)
Chris@16 9 #define FUSION_VALUE_AT_KEY_05052005_0229
Chris@16 10
Chris@16 11 #include <boost/mpl/int.hpp>
Chris@16 12 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
Chris@16 13 #include <boost/fusion/iterator/value_of_data.hpp>
Chris@16 14 #include <boost/fusion/algorithm/query/find.hpp>
Chris@16 15 #include <boost/fusion/support/tag_of.hpp>
Chris@16 16
Chris@16 17 namespace boost { namespace fusion
Chris@16 18 {
Chris@16 19 // Special tags:
Chris@16 20 struct sequence_facade_tag;
Chris@16 21 struct boost_array_tag; // boost::array tag
Chris@16 22 struct mpl_sequence_tag; // mpl sequence tag
Chris@16 23 struct std_pair_tag; // std::pair tag
Chris@16 24
Chris@16 25 namespace extension
Chris@16 26 {
Chris@16 27 template <typename Tag>
Chris@16 28 struct value_at_key_impl
Chris@16 29 {
Chris@16 30 template <typename Seq, typename Key>
Chris@16 31 struct apply
Chris@16 32 : result_of::value_of_data<
Chris@16 33 typename result_of::find<Seq, Key>::type
Chris@16 34 >
Chris@16 35 {};
Chris@16 36 };
Chris@16 37
Chris@16 38 template <>
Chris@16 39 struct value_at_key_impl<sequence_facade_tag>
Chris@16 40 {
Chris@16 41 template <typename Sequence, typename Key>
Chris@16 42 struct apply : Sequence::template value_at_key<Sequence, Key> {};
Chris@16 43 };
Chris@16 44
Chris@16 45 template <>
Chris@16 46 struct value_at_key_impl<boost_array_tag>;
Chris@16 47
Chris@16 48 template <>
Chris@16 49 struct value_at_key_impl<mpl_sequence_tag>;
Chris@16 50
Chris@16 51 template <>
Chris@16 52 struct value_at_key_impl<std_pair_tag>;
Chris@16 53 }
Chris@16 54
Chris@16 55 namespace result_of
Chris@16 56 {
Chris@16 57 template <typename Sequence, typename N>
Chris@16 58 struct value_at_key
Chris@16 59 : extension::value_at_key_impl<typename detail::tag_of<Sequence>::type>::
Chris@16 60 template apply<Sequence, N>
Chris@16 61 {};
Chris@16 62 }
Chris@16 63 }}
Chris@16 64
Chris@16 65 #endif
Chris@16 66