preprocessor.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifdef BOOST_HANA_WORKAROUND_MSVC_PREPROCESSOR_616033
  21. #define BOOST_HANA_PP_FRONT(...) BOOST_HANA_PP_FRONT_IMPL_I(__VA_ARGS__)
  22. #define BOOST_HANA_PP_FRONT_IMPL_I(...) BOOST_HANA_PP_CONCAT(BOOST_HANA_PP_FRONT_IMPL(__VA_ARGS__, ),)
  23. #else
  24. #define BOOST_HANA_PP_FRONT(...) BOOST_HANA_PP_FRONT_IMPL(__VA_ARGS__, )
  25. #endif
  26. #define BOOST_HANA_PP_FRONT_IMPL(e0, ...) e0
  27. //! @ingroup group-details
  28. //! Expands to all of its arguments, except for the first one.
  29. //!
  30. //! This macro may not be called with less than 2 arguments.
  31. #define BOOST_HANA_PP_DROP_FRONT(e0, ...) __VA_ARGS__
  32. #endif // !BOOST_HANA_DETAIL_PREPROCESSOR_HPP