value_of_impl.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 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(BOOST_FUSION_VALUE_OF_IMPL_20060223_1905)
  8. #define BOOST_FUSION_VALUE_OF_IMPL_20060223_1905
  9. #include <string>
  10. namespace example
  11. {
  12. struct example_struct_iterator_tag;
  13. template<typename Struct, int Pos>
  14. struct example_struct_iterator;
  15. }
  16. namespace boost { namespace fusion {
  17. namespace extension
  18. {
  19. template<typename Tag>
  20. struct value_of_impl;
  21. template<>
  22. struct value_of_impl<example::example_struct_iterator_tag>
  23. {
  24. template<typename Iterator>
  25. struct apply;
  26. template<typename Struct>
  27. struct apply<example::example_struct_iterator<Struct, 0> >
  28. {
  29. typedef std::string type;
  30. };
  31. template<typename Struct>
  32. struct apply<example::example_struct_iterator<Struct, 1> >
  33. {
  34. typedef int type;
  35. };
  36. };
  37. }
  38. }}
  39. #endif