2001-12-03 20:58:50 +00:00
|
|
|
// Copyright (C) 2001
|
|
|
|
// Housemarque Oy
|
|
|
|
// http://www.housemarque.com
|
|
|
|
//
|
|
|
|
// 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 as to its suitability for any purpose.
|
2001-11-25 18:32:11 +00:00
|
|
|
|
2001-12-03 20:58:50 +00:00
|
|
|
// See http://www.boost.org for most recent version.
|
2001-11-25 18:32:11 +00:00
|
|
|
|
2001-12-28 08:41:34 +00:00
|
|
|
#include <boost/preprocessor/empty.hpp>
|
|
|
|
#include <boost/preprocessor/if.hpp>
|
|
|
|
#include <boost/preprocessor/cat.hpp>
|
|
|
|
#include <boost/preprocessor/stringize.hpp>
|
|
|
|
|
|
|
|
#include <libs/preprocessor/test/test.hpp>
|
2001-11-25 18:32:11 +00:00
|
|
|
|
|
|
|
// ***
|
|
|
|
|
|
|
|
struct Container
|
|
|
|
{
|
2001-12-28 08:41:34 +00:00
|
|
|
#define BOOST_PP_DEF(CV)\
|
2001-11-25 18:32:11 +00:00
|
|
|
CV int& operator[](int i) CV;
|
|
|
|
|
2001-12-28 08:41:34 +00:00
|
|
|
BOOST_PP_DEF(BOOST_PP_EMPTY())
|
|
|
|
BOOST_PP_DEF(const)
|
|
|
|
BOOST_PP_DEF(volatile)
|
|
|
|
BOOST_PP_DEF(const volatile)
|
2001-11-25 18:32:11 +00:00
|
|
|
|
2001-12-28 08:41:34 +00:00
|
|
|
#undef BOOST_PP_DEF
|
2001-11-25 18:32:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// ***
|
|
|
|
|
2001-12-28 08:41:34 +00:00
|
|
|
TEST(BOOST_PP_IF(BOOST_PP_IF(1,1,1),true,false) &&
|
|
|
|
BOOST_PP_IF(BOOST_PP_IF(0,0,0),false,true))
|
2001-11-25 18:32:11 +00:00
|
|
|
|
|
|
|
// ***
|
|
|
|
|
2001-12-28 08:41:34 +00:00
|
|
|
TEST(BOOST_PP_CAT(BOOST_PP_IF(1,tru,fals), e))
|
2001-12-10 22:15:42 +00:00
|
|
|
|
2001-11-25 18:32:11 +00:00
|
|
|
// ***
|
|
|
|
|
2001-12-28 08:41:34 +00:00
|
|
|
char stringize_test[4] = BOOST_PP_STRINGIZE(__LINE__);
|