1 |
1 |
2 #ifndef BOOST_MPL_VECTOR_AUX_BEGIN_END_HPP_INCLUDED |
2 #ifndef BOOST_MPL_BEGIN_END_HPP_INCLUDED |
3 #define BOOST_MPL_VECTOR_AUX_BEGIN_END_HPP_INCLUDED |
3 #define BOOST_MPL_BEGIN_END_HPP_INCLUDED |
4 |
4 |
5 // Copyright Aleksey Gurtovoy 2000-2004 |
5 // Copyright Aleksey Gurtovoy 2000-2004 |
6 // |
6 // |
7 // Distributed under the Boost Software License, Version 1.0. |
7 // Distributed under the Boost Software License, Version 1.0. |
8 // (See accompanying file LICENSE_1_0.txt or copy at |
8 // (See accompanying file LICENSE_1_0.txt or copy at |
9 // http://www.boost.org/LICENSE_1_0.txt) |
9 // http://www.boost.org/LICENSE_1_0.txt) |
10 // |
10 // |
11 // See http://www.boost.org/libs/mpl for documentation. |
11 // See http://www.boost.org/libs/mpl for documentation. |
12 |
12 |
13 // $Source: /cvsroot/boost/boost/boost/mpl/vector/aux_/begin_end.hpp,v $ |
13 // $Source: /cvsroot/boost/boost/boost/mpl/begin_end.hpp,v $ |
14 // $Date: 2004/09/02 15:41:19 $ |
14 // $Date: 2004/09/02 15:40:41 $ |
15 // $Revision: 1.4 $ |
15 // $Revision: 1.4 $ |
16 |
16 |
17 #include <boost/mpl/aux_/config/typeof.hpp> |
17 #include <boost/mpl/begin_end_fwd.hpp> |
18 |
18 #include <boost/mpl/aux_/begin_end_impl.hpp> |
19 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES) |
19 #include <boost/mpl/sequence_tag.hpp> |
20 |
20 #include <boost/mpl/aux_/na_spec.hpp> |
21 # include <boost/mpl/begin_end_fwd.hpp> |
21 #include <boost/mpl/aux_/lambda_support.hpp> |
22 # include <boost/mpl/vector/aux_/iterator.hpp> |
|
23 # include <boost/mpl/vector/aux_/tag.hpp> |
|
24 |
22 |
25 namespace boost { namespace mpl { |
23 namespace boost { namespace mpl { |
26 |
24 |
27 template<> |
25 // agurt, 13/sep/02: switched from inheritance to typedef; MSVC is more |
28 struct begin_impl< aux::vector_tag > |
26 // happy this way (less ETI-related errors), and it doesn't affect |
|
27 // anything else |
|
28 template< |
|
29 typename BOOST_MPL_AUX_NA_PARAM(Sequence) |
|
30 > |
|
31 struct begin |
29 { |
32 { |
30 template< typename Vector > struct apply |
33 typedef typename sequence_tag<Sequence>::type tag_; |
31 { |
34 typedef typename begin_impl< tag_ > |
32 typedef v_iter<Vector,0> type; |
35 ::template apply< Sequence >::type type; |
33 }; |
36 |
|
37 BOOST_MPL_AUX_LAMBDA_SUPPORT(1,begin,(Sequence)) |
34 }; |
38 }; |
35 |
39 |
36 template<> |
40 template< |
37 struct end_impl< aux::vector_tag > |
41 typename BOOST_MPL_AUX_NA_PARAM(Sequence) |
|
42 > |
|
43 struct end |
38 { |
44 { |
39 template< typename Vector > struct apply |
45 typedef typename sequence_tag<Sequence>::type tag_; |
40 { |
46 typedef typename end_impl< tag_ > |
41 typedef v_iter<Vector,Vector::size::value> type; |
47 ::template apply< Sequence >::type type; |
42 }; |
48 |
|
49 BOOST_MPL_AUX_LAMBDA_SUPPORT(1,end,(Sequence)) |
43 }; |
50 }; |
|
51 |
|
52 BOOST_MPL_AUX_NA_SPEC(1, begin) |
|
53 BOOST_MPL_AUX_NA_SPEC(1, end) |
44 |
54 |
45 }} |
55 }} |
46 |
56 |
47 #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES |
57 #endif // BOOST_MPL_BEGIN_END_HPP_INCLUDED |
48 |
|
49 #endif // BOOST_MPL_VECTOR_AUX_BEGIN_END_HPP_INCLUDED |
|