From c995ffd177f16419533220c813079c66604bb970 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sat, 12 Jul 2014 19:04:34 +0900 Subject: [PATCH] fix container_range_traits overloads --- sprout/container/container_range_traits.hpp | 6 ++++++ sprout/range/range_container.hpp | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sprout/container/container_range_traits.hpp b/sprout/container/container_range_traits.hpp index 48b04a67..0b9db527 100644 --- a/sprout/container/container_range_traits.hpp +++ b/sprout/container/container_range_traits.hpp @@ -348,6 +348,12 @@ namespace sprout { , public sprout::detail::container_range_traits_range_at_impl , public sprout::detail::container_range_traits_range_at_const_impl { + using sprout::detail::container_range_traits_range_front_impl::range_front; + using sprout::detail::container_range_traits_range_front_const_impl::range_front; + using sprout::detail::container_range_traits_range_back_impl::range_back; + using sprout::detail::container_range_traits_range_back_const_impl::range_back; + using sprout::detail::container_range_traits_range_at_impl::range_at; + using sprout::detail::container_range_traits_range_at_const_impl::range_at; public: // iterators: static SPROUT_CONSTEXPR typename sprout::container_traits::iterator diff --git a/sprout/range/range_container.hpp b/sprout/range/range_container.hpp index d8c7e6ef..cc448e6b 100644 --- a/sprout/range/range_container.hpp +++ b/sprout/range/range_container.hpp @@ -33,11 +33,19 @@ namespace sprout { typedef iterator const_iterator; typedef typename std::iterator_traits::value_type value_type; typedef typename std::iterator_traits::reference reference; - typedef typename std::remove_reference::type const& const_reference; + typedef typename std::conditional< + std::is_reference::value, + typename std::remove_reference::type const&, + reference + >::type const_reference; typedef typename std::iterator_traits::difference_type difference_type; typedef typename std::make_unsigned::type size_type; typedef typename std::iterator_traits::pointer pointer; - typedef typename std::remove_pointer::type const* const_pointer; + typedef typename std::conditional< + std::is_pointer::value, + typename std::remove_pointer::type const*, + pointer + >::type const_pointer; private: iterator first_; iterator last_;