deduce_sequence.hpp 1.5 KB

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