Sprout/sprout/container/internal_begin.hpp

57 lines
1.9 KiB
C++
Raw Normal View History

2013-08-08 09:54:33 +00:00
/*=============================================================================
Copyright (c) 2011-2017 Bolero MURAKAMI
2013-08-08 09:54:33 +00:00
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_CONTAINER_INTERNAL_BEGIN_HPP
#define SPROUT_CONTAINER_INTERNAL_BEGIN_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/container/container_traits.hpp>
#include <sprout/container/sub_container_traits.hpp>
2013-02-26 01:43:27 +00:00
#include <sprout/container/deep_internal.hpp>
#include <sprout/container/begin.hpp>
2013-02-26 01:43:27 +00:00
#include <sprout/container/get_deep_internal.hpp>
namespace sprout {
//
// internal_begin
//
template<typename Container>
typename sprout::container_traits<
typename std::remove_reference<
2013-02-26 01:43:27 +00:00
typename sprout::containers::deep_internal<Container&>::type
>::type
2012-10-05 15:58:56 +00:00
>::iterator
internal_begin(Container& cont) {
2013-02-26 01:43:27 +00:00
return sprout::begin(sprout::get_deep_internal(cont));
}
template<typename Container>
inline SPROUT_CONSTEXPR typename sprout::container_traits<
typename std::remove_reference<
2013-02-26 01:43:27 +00:00
typename sprout::containers::deep_internal<Container const&>::type
>::type
2012-10-05 15:58:56 +00:00
>::const_iterator
internal_begin(Container const& cont) {
2013-02-26 01:43:27 +00:00
return sprout::begin(sprout::get_deep_internal(cont));
}
//
// internal_cbegin
//
template<typename Container>
inline SPROUT_CONSTEXPR typename sprout::container_traits<
typename std::remove_reference<
2013-02-26 01:43:27 +00:00
typename sprout::containers::deep_internal<Container const&>::type
>::type
2012-10-05 15:58:56 +00:00
>::const_iterator
internal_cbegin(Container const& cont) {
2013-02-26 01:43:27 +00:00
return sprout::begin(sprout::get_deep_internal(cont));
}
} // namespace sprout
#endif // #ifndef SPROUT_CONTAINER_INTERNAL_BEGIN_HPP