key_of_impl.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*=============================================================================
  2. Copyright (c) 2009 Christopher Schmidt
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #ifndef BOOST_FUSION_EXAMPLE_EXTENSION_DETAIL_KEY_OF_IMPL_HPP
  7. #define BOOST_FUSION_EXAMPLE_EXTENSION_DETAIL_KEY_OF_IMPL_HPP
  8. #include <boost/mpl/if.hpp>
  9. namespace fields
  10. {
  11. struct name;
  12. struct age;
  13. }
  14. namespace example
  15. {
  16. struct example_struct_iterator_tag;
  17. }
  18. namespace boost { namespace fusion {
  19. namespace extension
  20. {
  21. template<typename Tag>
  22. struct key_of_impl;
  23. template<>
  24. struct key_of_impl<example::example_struct_iterator_tag>
  25. {
  26. template<typename It>
  27. struct apply
  28. : mpl::if_c<!It::index::value, fields::name, fields::age>
  29. {};
  30. };
  31. }
  32. }}
  33. #endif