value_of_impl.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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_CONTAINER_MAP_DETAIL_VALUE_OF_IMPL_HPP
  7. #define BOOST_FUSION_CONTAINER_MAP_DETAIL_VALUE_OF_IMPL_HPP
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/sequence/intrinsic/value_at.hpp>
  10. #include <boost/type_traits/is_const.hpp>
  11. namespace boost { namespace fusion { namespace extension
  12. {
  13. template <typename>
  14. struct value_of_impl;
  15. template <>
  16. struct value_of_impl<map_iterator_tag>
  17. {
  18. template <typename It>
  19. struct apply
  20. {
  21. typedef typename
  22. result_of::value_at<
  23. typename mpl::if_<
  24. is_const<typename It::seq_type>
  25. , typename It::seq_type::storage_type const
  26. , typename It::seq_type::storage_type
  27. >::type
  28. , typename It::index
  29. >::type
  30. type;
  31. };
  32. };
  33. }}}
  34. #endif