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_IMPL_20060124_2129)
9 #define FUSION_VALUE_AT_IMPL_20060124_2129
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/container/vector/convert.hpp>
13 #include <boost/fusion/algorithm/transformation/transform.hpp>
14 #include <boost/fusion/sequence/intrinsic/value_at.hpp>
15 #include <boost/type_traits/remove_reference.hpp>
16 #include <boost/fusion/support/unused.hpp>
17 #include <boost/mpl/eval_if.hpp>
18 #include <boost/mpl/identity.hpp>
19 #include <boost/type_traits/is_same.hpp>
20 #include <boost/config.hpp>
22 namespace boost { namespace fusion {
34 template<typename N1, typename Seq>
35 struct result<poly_value_at<N1>(Seq)>
36 : mpl::eval_if<is_same<Seq, unused_type const&>,
37 mpl::identity<unused_type>,
38 result_of::value_at<typename remove_reference<Seq>::type, N> >
41 // never called, but needed for decltype-based result_of (C++0x)
42 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
43 template<typename Seq>
44 BOOST_FUSION_GPU_ENABLED
45 typename result<poly_value_at(Seq)>::type
46 operator()(Seq&&) const;
53 template<typename Tag>
57 struct value_at_impl<zip_view_tag>
59 template<typename Sequence, typename N>
62 typedef typename result_of::transform<
63 typename Sequence::sequences,
64 detail::poly_value_at<N> >::type values;
65 typedef typename result_of::as_vector<values>::type type;