~ubuntu-branches/ubuntu/breezy/aqsis/breezy

« back to all changes in this revision

Viewing changes to boost/boost/preprocessor/array/remove.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Will Newton
  • Date: 2004-12-07 20:06:49 UTC
  • Revision ID: james.westby@ubuntu.com-20041207200649-fccswkrvp4oc8lmn
Tags: upstream-0.9.3
ImportĀ upstreamĀ versionĀ 0.9.3

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_ARRAY_REMOVE_HPP
 
14
# define BOOST_PREPROCESSOR_ARRAY_REMOVE_HPP
 
15
#
 
16
# include <boost/preprocessor/arithmetic/inc.hpp>
 
17
# include <boost/preprocessor/array/elem.hpp>
 
18
# include <boost/preprocessor/array/push_back.hpp>
 
19
# include <boost/preprocessor/array/size.hpp>
 
20
# include <boost/preprocessor/comparison/not_equal.hpp>
 
21
# include <boost/preprocessor/control/deduce_d.hpp>
 
22
# include <boost/preprocessor/control/iif.hpp>
 
23
# include <boost/preprocessor/control/while.hpp>
 
24
# include <boost/preprocessor/tuple/eat.hpp>
 
25
# include <boost/preprocessor/tuple/elem.hpp>
 
26
#
 
27
# /* BOOST_PP_ARRAY_REMOVE */
 
28
#
 
29
# define BOOST_PP_ARRAY_REMOVE(array, i) BOOST_PP_ARRAY_REMOVE_I(BOOST_PP_DEDUCE_D(), array, i)
 
30
# define BOOST_PP_ARRAY_REMOVE_I(d, array, i) BOOST_PP_ARRAY_REMOVE_D(d, array, i)
 
31
#
 
32
# /* BOOST_PP_ARRAY_REMOVE_D */
 
33
#
 
34
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
 
35
#    define BOOST_PP_ARRAY_REMOVE_D(d, array, i) BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REMOVE_P, BOOST_PP_ARRAY_REMOVE_O, (0, i, (0, ()), array)))
 
36
# else
 
37
#    define BOOST_PP_ARRAY_REMOVE_D(d, array, i) BOOST_PP_ARRAY_REMOVE_D_I(d, array, i)
 
38
#    define BOOST_PP_ARRAY_REMOVE_D_I(d, array, i) BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_WHILE_ ## d(BOOST_PP_ARRAY_REMOVE_P, BOOST_PP_ARRAY_REMOVE_O, (0, i, (0, ()), array)))
 
39
# endif
 
40
#
 
41
# define BOOST_PP_ARRAY_REMOVE_P(d, st) BOOST_PP_NOT_EQUAL(BOOST_PP_TUPLE_ELEM(4, 0, st), BOOST_PP_ARRAY_SIZE(BOOST_PP_TUPLE_ELEM(4, 3, st)))
 
42
#
 
43
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
 
44
#    define BOOST_PP_ARRAY_REMOVE_O(d, st) BOOST_PP_ARRAY_REMOVE_O_I st
 
45
# else
 
46
#    define BOOST_PP_ARRAY_REMOVE_O(d, st) BOOST_PP_ARRAY_REMOVE_O_I(BOOST_PP_TUPLE_ELEM(4, 0, st), BOOST_PP_TUPLE_ELEM(4, 1, st), BOOST_PP_TUPLE_ELEM(4, 2, st), BOOST_PP_TUPLE_ELEM(4, 3, st))
 
47
# endif
 
48
#
 
49
# define BOOST_PP_ARRAY_REMOVE_O_I(n, i, res, arr) (BOOST_PP_INC(n), i, BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(n, i), BOOST_PP_ARRAY_PUSH_BACK, res BOOST_PP_TUPLE_EAT_2)(res, BOOST_PP_ARRAY_ELEM(n, arr)), arr)
 
50
#
 
51
# endif