1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2006 Dan Marsden
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(FUSION_VALUE_AT_KEY_05052005_0229)
9 #define FUSION_VALUE_AT_KEY_05052005_0229
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/mpl/int.hpp>
13 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
14 #include <boost/fusion/iterator/value_of_data.hpp>
15 #include <boost/fusion/algorithm/query/find.hpp>
16 #include <boost/fusion/support/tag_of.hpp>
18 namespace boost { namespace fusion
21 struct sequence_facade_tag;
22 struct boost_array_tag; // boost::array tag
23 struct mpl_sequence_tag; // mpl sequence tag
24 struct std_pair_tag; // std::pair tag
28 template <typename Tag>
29 struct value_at_key_impl
31 template <typename Seq, typename Key>
33 : result_of::value_of_data<
34 typename result_of::find<Seq, Key>::type
40 struct value_at_key_impl<sequence_facade_tag>
42 template <typename Sequence, typename Key>
43 struct apply : Sequence::template value_at_key<Sequence, Key> {};
47 struct value_at_key_impl<boost_array_tag>;
50 struct value_at_key_impl<mpl_sequence_tag>;
53 struct value_at_key_impl<std_pair_tag>;
58 template <typename Sequence, typename N>
60 : extension::value_at_key_impl<typename detail::tag_of<Sequence>::type>::
61 template apply<Sequence, N>