| 1 | // Copyright 2021 Peter Dimov |
| 2 | // Distributed under the Boost Software License, Version 1.0. |
| 3 | // https://www.boost.org/LICENSE_1_0.txt |
| 4 | |
| 5 | #include <boost/describe/detail/pp_utilities.hpp> |
| 6 | #include <boost/describe/detail/config.hpp> |
| 7 | #include <boost/core/lightweight_test.hpp> |
| 8 | |
| 9 | #if !defined(BOOST_DESCRIBE_CXX11) |
| 10 | |
| 11 | #include <boost/config/pragma_message.hpp> |
| 12 | |
| 13 | BOOST_PRAGMA_MESSAGE("Skipping test because C++11 is not available" ) |
| 14 | int main() {} |
| 15 | |
| 16 | #else |
| 17 | |
| 18 | #define S(x) S2(x) |
| 19 | #define S2(x) S3(x) |
| 20 | #define S3(x) S4(x) |
| 21 | #define S4(x) #x |
| 22 | |
| 23 | char const * s1 = S(BOOST_DESCRIBE_PP_POINTER(C1, x)); |
| 24 | char const * s2 = S((BOOST_DESCRIBE_PP_POINTER(C2, (R ()) y))); |
| 25 | char const * s3 = S((BOOST_DESCRIBE_PP_POINTER(C3, (R () const) z))); |
| 26 | char const * s4 = S((BOOST_DESCRIBE_PP_POINTER(C4, (R (A1)) v))); |
| 27 | char const * s5 = S((BOOST_DESCRIBE_PP_POINTER(C5, (R (A1, A2) const &&) w))); |
| 28 | |
| 29 | int main() |
| 30 | { |
| 31 | BOOST_TEST_CSTR_EQ( s1, "&C1::x" ); |
| 32 | BOOST_TEST_CSTR_EQ( s2, "(::boost::describe::detail::mfn<C2, R ()>(&C2::y))" ); |
| 33 | BOOST_TEST_CSTR_EQ( s3, "(::boost::describe::detail::mfn<C3, R () const>(&C3::z))" ); |
| 34 | BOOST_TEST_CSTR_EQ( s4, "(::boost::describe::detail::mfn<C4, R (A1)>(&C4::v))" ); |
| 35 | BOOST_TEST_CSTR_EQ( s5, "(::boost::describe::detail::mfn<C5, R (A1, A2) const &&>(&C5::w))" ); |
| 36 | |
| 37 | return boost::report_errors(); |
| 38 | } |
| 39 | |
| 40 | #endif // !defined(BOOST_DESCRIBE_CXX11) |
| 41 | |