value_at_key_impl.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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(BOOST_FUSION_VALUE_AT_KEY_IMPL_20060223_2025)
  8. #define BOOST_FUSION_VALUE_AT_KEY_IMPL_20060223_2025
  9. namespace fields
  10. {
  11. struct name;
  12. struct age;
  13. }
  14. namespace example
  15. {
  16. struct example_sequence_tag;
  17. }
  18. namespace boost { namespace fusion {
  19. namespace extension
  20. {
  21. template<typename Tag>
  22. struct value_at_key_impl;
  23. template<>
  24. struct value_at_key_impl<example::example_sequence_tag>
  25. {
  26. template<typename Sequence, typename N>
  27. struct apply;
  28. template<typename Sequence>
  29. struct apply<Sequence, fields::name>
  30. {
  31. typedef std::string type;
  32. };
  33. template<typename Sequence>
  34. struct apply<Sequence, fields::age>
  35. {
  36. typedef int type;
  37. };
  38. };
  39. }
  40. }}
  41. #endif