preprocessor.hpp 1.2 KB

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