key_of.hpp 1.1 KB

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