/Src/Dependencies/Boost/boost/fusion/container/map/detail/deref_impl.hpp

http://hadesmem.googlecode.com/ · C++ Header · 45 lines · 33 code · 6 blank · 6 comment · 0 complexity · 401bf395490880828096ea10aba0cb07 MD5 · raw file

  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_DEREF_IMPL_HPP
  7. #define BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_IMPL_HPP
  8. #include <boost/fusion/sequence/intrinsic/at.hpp>
  9. #include <boost/type_traits/is_const.hpp>
  10. namespace boost { namespace fusion { namespace extension
  11. {
  12. template <typename>
  13. struct deref_impl;
  14. template <>
  15. struct deref_impl<map_iterator_tag>
  16. {
  17. template <typename It>
  18. struct apply
  19. {
  20. typedef typename
  21. result_of::at<
  22. typename mpl::if_<
  23. is_const<typename It::seq_type>
  24. , typename It::seq_type::storage_type const
  25. , typename It::seq_type::storage_type
  26. >::type
  27. , typename It::index
  28. >::type
  29. type;
  30. static type
  31. call(It const& it)
  32. {
  33. return at<typename It::index>(it.seq->get_data());
  34. }
  35. };
  36. };
  37. }}}
  38. #endif