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

« back to all changes in this revision

Viewing changes to boost/boost/mpl/aux_/preprocessor/enum.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/aux_/preprocessor/enum.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
#ifndef BOOST_MPL_AUX_PREPROCESSOR_ENUM_HPP_INCLUDED
 
18
#define BOOST_MPL_AUX_PREPROCESSOR_ENUM_HPP_INCLUDED
 
19
 
 
20
#include "boost/mpl/aux_/config/preprocessor.hpp"
 
21
 
 
22
// BOOST_MPL_PP_ENUM(0,int): <nothing>
 
23
// BOOST_MPL_PP_ENUM(1,int): int
 
24
// BOOST_MPL_PP_ENUM(2,int): int, int
 
25
// BOOST_MPL_PP_ENUM(n,int): int, int, .., int
 
26
 
 
27
#if !defined(BOOST_MPL_NO_OWN_PP_PRIMITIVES)
 
28
 
 
29
#   include "boost/preprocessor/cat.hpp"
 
30
 
 
31
#   define BOOST_MPL_PP_ENUM(n, param) \
 
32
    BOOST_PP_CAT(BOOST_MPL_PP_ENUM_,n)(param) \
 
33
    /**/
 
34
    
 
35
#   define BOOST_MPL_PP_ENUM_0(p)
 
36
#   define BOOST_MPL_PP_ENUM_1(p) p
 
37
#   define BOOST_MPL_PP_ENUM_2(p) p,p
 
38
#   define BOOST_MPL_PP_ENUM_3(p) p,p,p
 
39
#   define BOOST_MPL_PP_ENUM_4(p) p,p,p,p
 
40
#   define BOOST_MPL_PP_ENUM_5(p) p,p,p,p,p
 
41
#   define BOOST_MPL_PP_ENUM_6(p) p,p,p,p,p,p
 
42
#   define BOOST_MPL_PP_ENUM_7(p) p,p,p,p,p,p,p
 
43
#   define BOOST_MPL_PP_ENUM_8(p) p,p,p,p,p,p,p,p
 
44
#   define BOOST_MPL_PP_ENUM_9(p) p,p,p,p,p,p,p,p,p
 
45
 
 
46
#else
 
47
 
 
48
#   include "boost/preprocessor/comma_if.hpp"
 
49
#   include "boost/preprocessor/repeat.hpp"
 
50
 
 
51
#   define BOOST_MPL_PP_AUX_ENUM_FUNC(unused, i, param) \
 
52
    BOOST_PP_COMMA_IF(i) param \
 
53
    /**/
 
54
 
 
55
#   define BOOST_MPL_PP_ENUM(n, param) \
 
56
    BOOST_PP_REPEAT_1( \
 
57
          n \
 
58
        , BOOST_MPL_PP_AUX_ENUM_FUNC \
 
59
        , param \
 
60
        ) \
 
61
    /**/
 
62
 
 
63
#endif // BOOST_MPL_NO_OWN_PP_PRIMITIVES
 
64
 
 
65
#endif // BOOST_MPL_AUX_PREPROCESSOR_ENUM_HPP_INCLUDED