Line | |
---|
1 | /*=============================================================================
|
---|
2 | Copyright (c) 2001-2003 Joel de Guzman
|
---|
3 | Copyright (c) 2004 Peder Holt
|
---|
4 |
|
---|
5 | Use, modification and distribution is subject to the Boost Software
|
---|
6 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
---|
7 | http://www.boost.org/LICENSE_1_0.txt)
|
---|
8 | ==============================================================================*/
|
---|
9 | #if !defined(FUSION_SEQUENCE_SIZE_HPP)
|
---|
10 | #define FUSION_SEQUENCE_SIZE_HPP
|
---|
11 |
|
---|
12 | #include <boost/spirit/fusion/detail/config.hpp>
|
---|
13 | #include <boost/spirit/fusion/sequence/as_fusion_sequence.hpp>
|
---|
14 |
|
---|
15 | namespace boost { namespace fusion
|
---|
16 | {
|
---|
17 | ///////////////////////////////////////////////////////////////////////////
|
---|
18 | //
|
---|
19 | // size metafunction
|
---|
20 | //
|
---|
21 | // Get the size of a Sequence. Usage:
|
---|
22 | //
|
---|
23 | // size<Sequence>::value
|
---|
24 | //
|
---|
25 | ///////////////////////////////////////////////////////////////////////////
|
---|
26 | namespace meta
|
---|
27 | {
|
---|
28 | template <typename Tag>
|
---|
29 | struct size_impl
|
---|
30 | {
|
---|
31 | template <typename Sequence>
|
---|
32 | struct apply {};
|
---|
33 | };
|
---|
34 |
|
---|
35 | template <typename Sequence>
|
---|
36 | struct size
|
---|
37 | : size_impl<typename as_fusion_sequence<Sequence>::type::tag>::
|
---|
38 | template apply<typename as_fusion_sequence<Sequence>::type>
|
---|
39 | {};
|
---|
40 | }
|
---|
41 | }}
|
---|
42 |
|
---|
43 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.