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

« back to all changes in this revision

Viewing changes to boost/boost/preprocessor/seq/for_each.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
#  *                                                                          *
 
3
#  *     (C) Copyright Paul Mensonides 2002.  Permission to copy, use,        *
 
4
#  *     modify, sell, and distribute this software is granted provided       *
 
5
#  *     this copyright notice appears in all copies.  This software is       *
 
6
#  *     provided "as is" without express or implied warranty, and with       *
 
7
#  *     no claim at to its suitability for any purpose.                      *
 
8
#  *                                                                          *
 
9
#  ************************************************************************** */
 
10
#
 
11
# /* See http://www.boost.org for most recent version. */
 
12
#
 
13
# ifndef BOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP
 
14
# define BOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP
 
15
#
 
16
# include <boost/preprocessor/arithmetic/dec.hpp>
 
17
# include <boost/preprocessor/config/config.hpp>
 
18
# include <boost/preprocessor/repetition/for.hpp>
 
19
# include <boost/preprocessor/seq/seq.hpp>
 
20
# include <boost/preprocessor/seq/size.hpp>
 
21
# include <boost/preprocessor/tuple/elem.hpp>
 
22
# include <boost/preprocessor/tuple/rem.hpp>
 
23
#
 
24
# /* BOOST_PP_SEQ_FOR_EACH */
 
25
#
 
26
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
 
27
#    define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
 
28
# else
 
29
#    define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq)
 
30
#    define BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
 
31
# endif
 
32
#
 
33
# define BOOST_PP_SEQ_FOR_EACH_P(r, x) BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(3, 2, x)))
 
34
#
 
35
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
 
36
#    define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I x
 
37
# else
 
38
#    define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I(BOOST_PP_TUPLE_ELEM(3, 0, x), BOOST_PP_TUPLE_ELEM(3, 1, x), BOOST_PP_TUPLE_ELEM(3, 2, x))
 
39
# endif
 
40
#
 
41
# define BOOST_PP_SEQ_FOR_EACH_O_I(macro, data, seq) (macro, data, BOOST_PP_SEQ_TAIL(seq))
 
42
#
 
43
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
 
44
#    define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_IM(r, BOOST_PP_TUPLE_REM_3 x)
 
45
#    define BOOST_PP_SEQ_FOR_EACH_M_IM(r, im) BOOST_PP_SEQ_FOR_EACH_M_I(r, im)
 
46
# else
 
47
#    define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_I(r, BOOST_PP_TUPLE_ELEM(3, 0, x), BOOST_PP_TUPLE_ELEM(3, 1, x), BOOST_PP_TUPLE_ELEM(3, 2, x))
 
48
# endif
 
49
#
 
50
# define BOOST_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq) macro(r, data, BOOST_PP_SEQ_HEAD(seq))
 
51
#
 
52
# /* BOOST_PP_SEQ_FOR_EACH_R */
 
53
#
 
54
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
 
55
#    define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
 
56
# else
 
57
#    define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq)
 
58
#    define BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
 
59
# endif
 
60
#
 
61
# endif