adapt_deref_traits.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  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. #if !defined(FUSION_ADAPT_DEREF_TRAITS_05062005_0900)
  7. #define FUSION_ADAPT_DEREF_TRAITS_05062005_0900
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/iterator/deref.hpp>
  10. namespace boost { namespace fusion { namespace detail
  11. {
  12. struct adapt_deref_traits
  13. {
  14. template <typename Iterator>
  15. struct apply
  16. {
  17. typedef typename
  18. result_of::deref<typename Iterator::first_type>::type
  19. type;
  20. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  21. static type
  22. call(Iterator const& i)
  23. {
  24. return *i.first;
  25. }
  26. };
  27. };
  28. }}}
  29. #endif