mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-14 13:06:33 +02:00
initial revision
[SVN r15198]
This commit is contained in:
36
regression/array.cpp
Normal file
36
regression/array.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Paul Mensonides 2002. Permission to copy, use, *
|
||||
# * modify, sell, and distribute this software is granted provided *
|
||||
# * this copyright notice appears in all copies. This software is *
|
||||
# * provided "as is" without express or implied warranty, and with *
|
||||
# * no claim at to its suitability for any purpose. *
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/array.hpp>
|
||||
# include <libs/preprocessor/regression/test.h>
|
||||
|
||||
# define ARRAY (3, (0, 1, 2))
|
||||
|
||||
// element access
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(1, ARRAY) == 1 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(2, (5, (0, 1, 2, 3, 4))) == 2 END
|
||||
|
||||
# define P1 (3,
|
||||
# define P2 (
|
||||
# define P3 0, 1
|
||||
# define P4 , 2)
|
||||
# define P5 )
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(0, P1 P2 P3 P4 P5) == 0 END
|
||||
|
||||
// size
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(ARRAY) == 3 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE((5, (0, 1, 2, 3, 4))) == 5 END
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(P1 P2 P3 P4 P5) == 5 END
|
Reference in New Issue
Block a user