deduce_sequence.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #if !defined(BOOST_FUSION_SUPPORT_DEDUCE_SEQUENCE_HPP_INCLUDED)
  8. #define BOOST_FUSION_SUPPORT_DEDUCE_SEQUENCE_HPP_INCLUDED
  9. #include <boost/fusion/support/config.hpp>
  10. #include <boost/fusion/support/deduce.hpp>
  11. #include <boost/fusion/container/vector/convert.hpp>
  12. #include <boost/fusion/view/transform_view.hpp>
  13. #include <boost/config.hpp>
  14. namespace boost { namespace fusion { namespace traits
  15. {
  16. template <class Sequence> struct deduce_sequence;
  17. namespace detail
  18. {
  19. struct deducer
  20. {
  21. template <typename Sig>
  22. struct result;
  23. template <class Self, typename T>
  24. struct result< Self(T) >
  25. : fusion::traits::deduce<T>
  26. { };
  27. // never called, but needed for decltype-based result_of (C++0x)
  28. #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
  29. template <typename T>
  30. BOOST_FUSION_GPU_ENABLED
  31. typename result< deducer(T) >::type
  32. operator()(T&&) const;
  33. #endif
  34. };
  35. }
  36. template <class Sequence>
  37. struct deduce_sequence
  38. : result_of::as_vector<
  39. fusion::transform_view<Sequence, detail::deducer> >
  40. { };
  41. }}}
  42. #endif