gen_make_adapter.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*=============================================================================
  2. Copyright (c) 2007 Tobias Schwinger
  3. Use modification and distribution are subject to the Boost Software
  4. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ==============================================================================*/
  7. // No include guard - this file is included multiple times intentionally.
  8. #include <boost/preprocessor/cat.hpp>
  9. #include <boost/fusion/support/detail/as_fusion_element.hpp>
  10. #if !defined(BOOST_FUSION_CLASS_TPL_NAME)
  11. # error "BOOST_FUSION_CLASS_TPL_NAME undefined"
  12. #endif
  13. #define BOOST_FUSION_FUNC_NAME BOOST_PP_CAT(make_,BOOST_FUSION_CLASS_TPL_NAME)
  14. namespace boost { namespace fusion
  15. {
  16. namespace result_of
  17. {
  18. template <typename F>
  19. struct BOOST_FUSION_FUNC_NAME
  20. {
  21. typedef fusion::BOOST_FUSION_CLASS_TPL_NAME<
  22. typename fusion::detail::as_fusion_element<F>::type > type;
  23. };
  24. }
  25. template <typename F>
  26. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  27. inline typename result_of::BOOST_FUSION_FUNC_NAME<F>::type
  28. BOOST_FUSION_FUNC_NAME(F const & f)
  29. {
  30. return typename result_of::BOOST_FUSION_FUNC_NAME<F>::type(f);
  31. }
  32. }}
  33. #undef BOOST_FUSION_CLASS_TPL_NAME
  34. #undef BOOST_FUSION_FUNC_NAME