get_data.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # /* **************************************************************************
  2. # * *
  3. # * (C) Copyright Edward Diener 2014. *
  4. # * Distributed under the Boost Software License, Version 1.0. (See *
  5. # * accompanying file LICENSE_1_0.txt or copy at *
  6. # * http://www.boost.org/LICENSE_1_0.txt) *
  7. # * *
  8. # ************************************************************************** */
  9. #
  10. # /* See http://www.boost.org for most recent version. */
  11. #
  12. # ifndef BOOST_PREPROCESSOR_ARRAY_DETAIL_GET_DATA_HPP
  13. # define BOOST_PREPROCESSOR_ARRAY_DETAIL_GET_DATA_HPP
  14. #
  15. # include <boost/preprocessor/config/config.hpp>
  16. # include <boost/preprocessor/tuple/rem.hpp>
  17. # include <boost/preprocessor/control/if.hpp>
  18. # include <boost/preprocessor/control/iif.hpp>
  19. # include <boost/preprocessor/facilities/is_1.hpp>
  20. #
  21. # /* BOOST_PP_ARRAY_DETAIL_GET_DATA */
  22. #
  23. # define BOOST_PP_ARRAY_DETAIL_GET_DATA_NONE(size, data)
  24. # if BOOST_PP_VARIADICS && !(BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400)
  25. # if BOOST_PP_VARIADICS_MSVC
  26. # define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_DEFAULT(size, data) BOOST_PP_TUPLE_REM(size) data
  27. # define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_CAT(size, data) BOOST_PP_TUPLE_REM_CAT(size) data
  28. # define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) \
  29. BOOST_PP_IIF \
  30. ( \
  31. BOOST_PP_IS_1(size), \
  32. BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_CAT, \
  33. BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_DEFAULT \
  34. ) \
  35. (size,data) \
  36. /**/
  37. # else
  38. # define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) BOOST_PP_TUPLE_REM(size) data
  39. # endif
  40. # else
  41. # define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) BOOST_PP_TUPLE_REM(size) data
  42. # endif
  43. # define BOOST_PP_ARRAY_DETAIL_GET_DATA(size, data) \
  44. BOOST_PP_IF \
  45. ( \
  46. size, \
  47. BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY, \
  48. BOOST_PP_ARRAY_DETAIL_GET_DATA_NONE \
  49. ) \
  50. (size,data) \
  51. /**/
  52. #
  53. # endif /* BOOST_PREPROCESSOR_ARRAY_DETAIL_GET_DATA_HPP */