~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to boost/boost/mpl/quote.hpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//-----------------------------------------------------------------------------
 
2
// boost mpl/quote.hpp header file
 
3
// See http://www.boost.org for updates, documentation, and revision history.
 
4
//-----------------------------------------------------------------------------
 
5
//
 
6
// Copyright (c) 2000-02
 
7
// Aleksey Gurtovoy
 
8
//
 
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.
 
16
 
 
17
#if !defined(BOOST_PP_IS_ITERATING)
 
18
 
 
19
///// header body
 
20
 
 
21
#ifndef BOOST_MPL_QUOTE_HPP_INCLUDED
 
22
#define BOOST_MPL_QUOTE_HPP_INCLUDED
 
23
 
 
24
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
 
25
#   include "boost/mpl/aux_/has_type.hpp"
 
26
#endif
 
27
 
 
28
#include "boost/mpl/aux_/config/use_preprocessed.hpp"
 
29
 
 
30
#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
 
31
 && !defined(BOOST_MPL_PREPROCESSING_MODE)
 
32
 
 
33
#   define BOOST_MPL_PREPROCESSED_HEADER quote.hpp
 
34
#   include "boost/mpl/aux_/include_preprocessed.hpp"
 
35
 
 
36
#else
 
37
 
 
38
#   include "boost/mpl/limits/arity.hpp"
 
39
#   include "boost/mpl/aux_/preprocessor/params.hpp"
 
40
#   include "boost/mpl/aux_/config/ttp.hpp"
 
41
#   include "boost/mpl/aux_/config/ctps.hpp"
 
42
 
 
43
#   include "boost/preprocessor/iterate.hpp"
 
44
#   include "boost/preprocessor/cat.hpp"
 
45
 
 
46
#if !defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS)
 
47
 
 
48
namespace boost {
 
49
namespace mpl {
 
50
 
 
51
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
 
52
 
 
53
template< typename T, bool has_type_ = aux::has_type<T>::value >
 
54
struct quote_impl
 
55
#if !defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG))
 
56
    : T
 
57
{
 
58
#else
 
59
{
 
60
    typedef typename T::type type;
 
61
#endif
 
62
};
 
63
 
 
64
template< typename T >
 
65
struct quote_impl<T,false>
 
66
{
 
67
    typedef T type;
 
68
};
 
69
 
 
70
#else
 
71
 
 
72
template< bool > struct quote_impl
 
73
{
 
74
    template< typename T > struct result_
 
75
        : T
 
76
    {
 
77
    };
 
78
};
 
79
 
 
80
template<> struct quote_impl<false>
 
81
{
 
82
    template< typename T > struct result_
 
83
    {
 
84
        typedef T type;
 
85
    };
 
86
};
 
87
 
 
88
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
89
 
 
90
#define BOOST_PP_ITERATION_PARAMS_1 \
 
91
    (3,(1, BOOST_MPL_METAFUNCTION_MAX_ARITY, "boost/mpl/quote.hpp"))
 
92
#include BOOST_PP_ITERATE()
 
93
 
 
94
} // namespace mpl
 
95
} // namespace boost
 
96
 
 
97
#endif // BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS
 
98
 
 
99
#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
 
100
#endif // BOOST_MPL_QUOTE_HPP_INCLUDED
 
101
 
 
102
///// iteration
 
103
 
 
104
#else
 
105
#define i BOOST_PP_FRAME_ITERATION(1)
 
106
 
 
107
template<
 
108
      template< BOOST_MPL_PP_PARAMS(i, typename P) > class F
 
109
    >
 
110
struct BOOST_PP_CAT(quote,i)
 
111
{
 
112
    template< BOOST_MPL_PP_PARAMS(i, typename U) > struct apply
 
113
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
 
114
        : quote_impl< F< BOOST_MPL_PP_PARAMS(i, U) > >
 
115
#else
 
116
        : quote_impl< aux::has_type< F< BOOST_MPL_PP_PARAMS(i, U) > >::value >
 
117
            ::template result_< F< BOOST_MPL_PP_PARAMS(i, U) > >
 
118
#endif
 
119
    {
 
120
    };
 
121
};
 
122
 
 
123
#undef i
 
124
#endif // BOOST_PP_IS_ITERATING