1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

[desuructive changes] container traits new interface [破壊的変更]

This commit is contained in:
bolero-MURAKAMI 2012-03-31 16:24:13 +09:00
parent 52a2178ac1
commit ad60c8c530
356 changed files with 3183 additions and 3251 deletions

43
sprout/container/end.hpp Normal file
View file

@ -0,0 +1,43 @@
#ifndef SPROUT_CONTAINER_END_HPP
#define SPROUT_CONTAINER_END_HPP
#include <cstddef>
#include <sprout/config.hpp>
#include <sprout/container/container_traits.hpp>
namespace sprout {
//
// end
//
template<typename Container>
inline typename sprout::container_traits<Container>::iterator end(Container& cont) {
return cont.end();
}
template<typename T, std::size_t N>
inline typename sprout::container_traits<T[N]>::iterator end(T (& arr)[N]) {
return arr + N;
}
template<typename Container>
SPROUT_CONSTEXPR inline typename sprout::container_traits<Container>::const_iterator end(Container const& cont) {
return cont.end();
}
template<typename T, std::size_t N>
SPROUT_CONSTEXPR inline typename sprout::container_traits<T const[N]>::const_iterator end(T const (& arr)[N]) {
return arr + N;
}
//
// cend
//
template<typename Container>
SPROUT_CONSTEXPR inline typename sprout::container_traits<Container>::const_iterator cend(Container const& cont) {
return cont.end();
}
template<typename T, std::size_t N>
SPROUT_CONSTEXPR inline typename sprout::container_traits<T const[N]>::const_iterator cend(T const (& arr)[N]) {
return arr + N;
}
} // namespace sprout
#endif // #ifndef SPROUT_CONTAINER_END_HPP