blob: bf1eab5b5c2b48d2bda35629cd84486c2946ab4b [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001# /* Copyright (C) 2001
2# * Housemarque Oy
3# * http://www.housemarque.com
4# *
5# * Distributed under the Boost Software License, Version 1.0. (See
6# * accompanying file LICENSE_1_0.txt or copy at
7# * http://www.boost.org/LICENSE_1_0.txt)
8# */
9#
10# /* Revised by Paul Mensonides (2002) */
11#
12# /* See http://www.boost.org for most recent version. */
13#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070014# ifndef NDNBOOST_PREPROCESSOR_LIST_REVERSE_HPP
15# define NDNBOOST_PREPROCESSOR_LIST_REVERSE_HPP
Jeff Thompsonf7d49942013-08-01 16:47:40 -070016#
Jeff Thompson2277ce52013-08-01 17:34:11 -070017# include <ndnboost/preprocessor/config/config.hpp>
18# include <ndnboost/preprocessor/list/fold_left.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070019#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070020# /* NDNBOOST_PP_LIST_REVERSE */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070021#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG()
23# define NDNBOOST_PP_LIST_REVERSE(list) NDNBOOST_PP_LIST_FOLD_LEFT(NDNBOOST_PP_LIST_REVERSE_O, NDNBOOST_PP_NIL, list)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070024# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070025# define NDNBOOST_PP_LIST_REVERSE(list) NDNBOOST_PP_LIST_REVERSE_I(list)
26# define NDNBOOST_PP_LIST_REVERSE_I(list) NDNBOOST_PP_LIST_FOLD_LEFT(NDNBOOST_PP_LIST_REVERSE_O, NDNBOOST_PP_NIL, list)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070027# endif
28#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070029# define NDNBOOST_PP_LIST_REVERSE_O(d, s, x) (x, s)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070030#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031# /* NDNBOOST_PP_LIST_REVERSE_D */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070032#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070033# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG()
34# define NDNBOOST_PP_LIST_REVERSE_D(d, list) NDNBOOST_PP_LIST_FOLD_LEFT_ ## d(NDNBOOST_PP_LIST_REVERSE_O, NDNBOOST_PP_NIL, list)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070035# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070036# define NDNBOOST_PP_LIST_REVERSE_D(d, list) NDNBOOST_PP_LIST_REVERSE_D_I(d, list)
37# define NDNBOOST_PP_LIST_REVERSE_D_I(d, list) NDNBOOST_PP_LIST_FOLD_LEFT_ ## d(NDNBOOST_PP_LIST_REVERSE_O, NDNBOOST_PP_NIL, list)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070038# endif
39#
40# endif