make_list.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*=============================================================================
  2. Copyright (c) 2014 Kohei Takahashi
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #ifndef FUSION_MAKE_LIST_10262014_0647
  7. #define FUSION_MAKE_LIST_10262014_0647
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/container/list/list.hpp>
  10. #if !defined(BOOST_FUSION_HAS_VARIADIC_LIST)
  11. # include <boost/fusion/container/generation/detail/pp_make_list.hpp>
  12. #else
  13. ///////////////////////////////////////////////////////////////////////////////
  14. // C++11 variadic interface
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #include <boost/fusion/support/detail/as_fusion_element.hpp>
  17. namespace boost { namespace fusion
  18. {
  19. namespace result_of
  20. {
  21. template <typename ...T>
  22. struct make_list
  23. {
  24. typedef list<typename detail::as_fusion_element<T>::type...> type;
  25. };
  26. }
  27. template <typename ...T>
  28. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  29. inline typename result_of::make_list<T...>::type
  30. make_list(T const&... arg)
  31. {
  32. return typename result_of::make_list<T...>::type(arg...);
  33. }
  34. }}
  35. #endif
  36. #endif