| 1 | /*! |
| 2 | @file |
| 3 | Defines generally useful preprocessor macros. |
| 4 | |
| 5 | Copyright Louis Dionne 2013-2022 |
| 6 | Distributed under the Boost Software License, Version 1.0. |
| 7 | (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) |
| 8 | */ |
| 9 | |
| 10 | #ifndef BOOST_HANA_DETAIL_PREPROCESSOR_HPP |
| 11 | #define BOOST_HANA_DETAIL_PREPROCESSOR_HPP |
| 12 | |
| 13 | //! @ingroup group-details |
| 14 | //! Expands to the concatenation of its two arguments. |
| 15 | #define BOOST_HANA_PP_CONCAT(x, y) BOOST_HANA_PP_CONCAT_PRIMITIVE(x, y) |
| 16 | #define BOOST_HANA_PP_CONCAT_PRIMITIVE(x, y) x ## y |
| 17 | |
| 18 | //! @ingroup group-details |
| 19 | //! Expands to the stringized version of its argument. |
| 20 | #define BOOST_HANA_PP_STRINGIZE(...) BOOST_HANA_PP_STRINGIZE_PRIMITIVE(__VA_ARGS__) |
| 21 | #define BOOST_HANA_PP_STRINGIZE_PRIMITIVE(...) #__VA_ARGS__ |
| 22 | |
| 23 | //! @ingroup group-details |
| 24 | //! Expands to its first argument. |
| 25 | #ifdef BOOST_HANA_WORKAROUND_MSVC_PREPROCESSOR_616033 |
| 26 | #define BOOST_HANA_PP_FRONT(...) BOOST_HANA_PP_FRONT_IMPL_I(__VA_ARGS__) |
| 27 | #define BOOST_HANA_PP_FRONT_IMPL_I(...) BOOST_HANA_PP_CONCAT(BOOST_HANA_PP_FRONT_IMPL(__VA_ARGS__, ),) |
| 28 | #else |
| 29 | #define BOOST_HANA_PP_FRONT(...) BOOST_HANA_PP_FRONT_IMPL(__VA_ARGS__, ) |
| 30 | #endif |
| 31 | #define BOOST_HANA_PP_FRONT_IMPL(e0, ...) e0 |
| 32 | |
| 33 | //! @ingroup group-details |
| 34 | //! Expands to all of its arguments, except for the first one. |
| 35 | //! |
| 36 | //! This macro may not be called with less than 2 arguments. |
| 37 | #define BOOST_HANA_PP_DROP_FRONT(e0, ...) __VA_ARGS__ |
| 38 | |
| 39 | #endif // !BOOST_HANA_DETAIL_PREPROCESSOR_HPP |
| 40 | |