#ifndef SPROUT_CONTAINER_BEGIN_HPP #define SPROUT_CONTAINER_BEGIN_HPP #include #include #include #include namespace sprout_adl { sprout::not_found_via_adl range_begin(...); } // namespace sprout_adl namespace sprout { namespace container_detail { template inline typename sprout::container_traits::iterator range_begin(Container& cont) { return cont.begin(); } template inline SPROUT_CONSTEXPR typename sprout::container_traits::const_iterator range_begin(Container const& cont) { return cont.begin(); } template inline typename sprout::container_traits::iterator range_begin(T (& arr)[N]) { typedef typename sprout::container_traits::iterator iterator; return iterator(arr); } template inline SPROUT_CONSTEXPR typename sprout::container_traits::const_iterator range_begin(T const (& arr)[N]) { typedef typename sprout::container_traits::const_iterator iterator; return iterator(arr); } } // namespace container_detail } // namespace sprout namespace sprout { // // begin // template inline typename sprout::container_traits::iterator begin(Container& cont) { using sprout::container_detail::range_begin; using sprout_adl::range_begin; return range_begin(cont); } template inline SPROUT_CONSTEXPR typename sprout::container_traits::const_iterator begin(Container const& cont) { using sprout::container_detail::range_begin; using sprout_adl::range_begin; return range_begin(cont); } template inline typename sprout::container_traits::iterator begin(T (& arr)[N]) { return sprout::container_detail::range_begin(arr); } template inline SPROUT_CONSTEXPR typename sprout::container_traits::const_iterator begin(T const (& arr)[N]) { return sprout::container_detail::range_begin(arr); } // // cbegin // template inline SPROUT_CONSTEXPR typename sprout::container_traits::const_iterator cbegin(Container const& cont) { using sprout::container_detail::range_begin; using sprout_adl::range_begin; return range_begin(cont); } template inline SPROUT_CONSTEXPR typename sprout::container_traits::const_iterator cbegin(T const (& arr)[N]) { return sprout::container_detail::range_begin(arr); } } // namespace sprout #endif // #ifndef SPROUT_CONTAINER_BEGIN_HPP