convert_impl.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2005-2006 Dan Marsden
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #if !defined(FUSION_CONVERT_IMPL_09232005_1341)
  8. #define FUSION_CONVERT_IMPL_09232005_1341
  9. #include <boost/fusion/container/set/detail/as_set.hpp>
  10. #include <boost/fusion/container/set/set.hpp>
  11. #include <boost/fusion/sequence/intrinsic/begin.hpp>
  12. #include <boost/fusion/sequence/intrinsic/size.hpp>
  13. namespace boost { namespace fusion
  14. {
  15. struct set_tag;
  16. namespace extension
  17. {
  18. template <typename T>
  19. struct convert_impl;
  20. template <>
  21. struct convert_impl<set_tag>
  22. {
  23. template <typename Sequence>
  24. struct apply
  25. {
  26. typedef typename detail::as_set<result_of::size<Sequence>::value> gen;
  27. typedef typename gen::
  28. template apply<typename result_of::begin<Sequence>::type>::type
  29. type;
  30. static type call(Sequence& seq)
  31. {
  32. return gen::call(fusion::begin(seq));
  33. }
  34. };
  35. };
  36. }
  37. }}
  38. #endif