1 /*=============================================================================
2 Copyright (c) 2001-2006 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_SIZE_05052005_0214)
8 #define FUSION_SIZE_05052005_0214
10 #include <boost/mpl/int.hpp>
11 #include <boost/fusion/support/tag_of.hpp>
13 namespace boost { namespace fusion
16 struct sequence_facade_tag;
17 struct boost_tuple_tag; // boost::tuples::tuple tag
18 struct boost_array_tag; // boost::array tag
19 struct mpl_sequence_tag; // mpl sequence tag
20 struct std_pair_tag; // std::pair tag
24 template <typename Tag>
27 template <typename Sequence>
28 struct apply : Sequence::size {};
32 struct size_impl<sequence_facade_tag>
34 template <typename Sequence>
35 struct apply : Sequence::template size<Sequence> {};
39 struct size_impl<boost_tuple_tag>;
42 struct size_impl<boost_array_tag>;
45 struct size_impl<mpl_sequence_tag>;
48 struct size_impl<std_pair_tag>;
53 template <typename Sequence>
55 : extension::size_impl<typename detail::tag_of<Sequence>::type>::
56 template apply<Sequence>
59 typedef typename extension::size_impl<typename detail::tag_of<Sequence>::type>::
60 template apply<Sequence>::type size_application;
61 BOOST_STATIC_CONSTANT(int, value = size_application::value);
65 template <typename Sequence>
66 inline typename result_of::size<Sequence>::type
69 typedef typename result_of::size<Sequence>::type result;