1
//-----------------------------------------------------------------------------
2
// boost mpl/sequence_tag.hpp header file
3
// See http://www.boost.org for updates, documentation, and revision history.
4
//-----------------------------------------------------------------------------
6
// Copyright (c) 2000-02
9
// Permission to use, copy, modify, distribute and sell this software
10
// and its documentation for any purpose is hereby granted without fee,
11
// provided that the above copyright notice appears in all copies and
12
// that both the copyright notice and this permission notice appear in
13
// supporting documentation. No representations are made about the
14
// suitability of this software for any purpose. It is provided "as is"
15
// without express or implied warranty.
17
#ifndef BOOST_MPL_SEQUENCE_TAG_HPP_INCLUDED
18
#define BOOST_MPL_SEQUENCE_TAG_HPP_INCLUDED
20
#include "boost/mpl/sequence_tag_fwd.hpp"
21
#include "boost/mpl/aux_/has_tag.hpp"
22
#include "boost/mpl/aux_/has_begin.hpp"
23
#include "boost/mpl/aux_/void_spec.hpp"
24
#include "boost/mpl/aux_/is_msvc_eti_arg.hpp"
25
#include "boost/mpl/aux_/config/eti.hpp"
26
#include "boost/mpl/aux_/yes_no.hpp"
27
#include "boost/mpl/aux_/config/workaround.hpp"
29
namespace boost { namespace mpl {
31
// agurt, 27/nov/02: have to use a simplistic 'sequence_tag' implementation
32
// on MSVC to avoid dreadful "internal structure overflow" error
33
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
36
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Sequence)
40
typedef typename Sequence::tag type;
43
#elif BOOST_WORKAROUND(BOOST_MSVC, == 1300)
45
// agurt, 07/feb/03: workaround for what seems to be MSVC 7.0-specific ETI issue
50
struct sequence_tag_impl
52
template< typename Sequence > struct result_
54
typedef typename Sequence::tag type;
59
struct sequence_tag_impl<false>
61
template< typename Sequence > struct result_
70
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Sequence)
73
: aux::sequence_tag_impl< !aux::is_msvc_eti_arg<Sequence>::value >
74
::template result_<Sequence>
82
template< bool has_tag_, bool has_begin_ >
83
struct sequence_tag_impl
85
// agurt 24/nov/02: MSVC 6.5 gets confused in 'sequence_tag_impl<true>'
86
// specialization below, if we name it 'result_' here
87
template< typename Sequence > struct result2_;
90
# define AUX_CLASS_SEQUENCE_TAG_SPEC(has_tag, has_begin, result_type) \
91
template<> struct sequence_tag_impl<has_tag,has_begin> \
93
template< typename Sequence > struct result2_ \
95
typedef result_type type; \
100
AUX_CLASS_SEQUENCE_TAG_SPEC(true, true, typename Sequence::tag)
101
AUX_CLASS_SEQUENCE_TAG_SPEC(true, false, typename Sequence::tag)
102
AUX_CLASS_SEQUENCE_TAG_SPEC(false, true, nested_begin_end_tag)
103
AUX_CLASS_SEQUENCE_TAG_SPEC(false, false, non_sequence_tag)
105
# undef AUX_CLASS_SEQUENCE_TAG_SPEC
110
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Sequence)
113
: aux::sequence_tag_impl<
114
::boost::mpl::aux::has_tag<Sequence>::value
115
, ::boost::mpl::aux::has_begin<Sequence>::value
116
>::template result2_<Sequence>
122
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
123
template<> struct sequence_tag<int>
129
BOOST_MPL_AUX_VOID_SPEC(1, sequence_tag)
131
}} // namespace boost::mpl
133
#endif // BOOST_MPL_SEQUENCE_TAG_HPP_INCLUDED