key_of.hpp 1.1 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_ITERATOR_KEY_OF_HPP
  7. #define BOOST_FUSION_ITERATOR_KEY_OF_HPP
  8. #include <boost/fusion/support/tag_of.hpp>
  9. namespace boost { namespace fusion
  10. {
  11. struct iterator_facade_tag;
  12. namespace extension
  13. {
  14. template <typename>
  15. struct key_of_impl;
  16. template <>
  17. struct key_of_impl<iterator_facade_tag>
  18. {
  19. template <typename It>
  20. struct apply
  21. : It::template key_of<It>
  22. {};
  23. };
  24. }
  25. namespace result_of
  26. {
  27. template <typename It>
  28. struct key_of
  29. : extension::key_of_impl<typename traits::tag_of<It>::type>::
  30. template apply<It>
  31. {};
  32. }
  33. }}
  34. #endif