2011-09-01 02:48:32 +00:00
|
|
|
#ifndef SPROUT_ADAPT_SSCRISK_CEL_ARRAY_HPP
|
|
|
|
#define SPROUT_ADAPT_SSCRISK_CEL_ARRAY_HPP
|
|
|
|
|
|
|
|
#include <sscrisk/cel/array.hpp>
|
|
|
|
#include <sprout/config.hpp>
|
2012-03-31 07:24:13 +00:00
|
|
|
#include <sprout/container/traits.hpp>
|
2011-10-11 15:38:14 +00:00
|
|
|
#if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION
|
2012-03-31 07:24:13 +00:00
|
|
|
# include <cstddef>
|
|
|
|
# include <type_traits>
|
|
|
|
# include <sprout/container/begin.hpp>
|
|
|
|
# include <sprout/container/end.hpp>
|
2011-10-11 15:38:14 +00:00
|
|
|
# include <sprout/iterator/index_iterator.hpp>
|
|
|
|
#endif
|
2011-09-01 02:48:32 +00:00
|
|
|
|
|
|
|
namespace sprout {
|
2011-10-11 15:38:14 +00:00
|
|
|
#if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION
|
|
|
|
//
|
2012-03-31 07:24:13 +00:00
|
|
|
// container_traits
|
2011-10-11 15:38:14 +00:00
|
|
|
//
|
|
|
|
template<typename T, std::size_t N>
|
2012-03-31 07:24:13 +00:00
|
|
|
struct container_traits<sscrisk::cel::array<T, N> >
|
2012-04-30 01:55:33 +00:00
|
|
|
: public sprout::detail::container_traits_default<sscrisk::cel::array<T, N> >
|
2011-10-11 15:38:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-03-31 07:24:13 +00:00
|
|
|
typedef sprout::index_iterator<sscrisk::cel::array<T, N>&> iterator;
|
|
|
|
typedef sprout::index_iterator<sscrisk::cel::array<T, N> const&> const_iterator;
|
2011-10-11 15:38:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// begin
|
|
|
|
//
|
|
|
|
template<typename T, std::size_t N>
|
2012-04-04 13:23:41 +00:00
|
|
|
inline typename sprout::container_traits<sscrisk::cel::array<T, N> >::iterator begin(sscrisk::cel::array<T, N>& cont) {
|
2012-03-31 07:24:13 +00:00
|
|
|
return typename sprout::container_traits<sscrisk::cel::array<T, N> >::iterator(cont, 0);
|
2011-10-11 15:38:14 +00:00
|
|
|
}
|
|
|
|
template<typename T, std::size_t N>
|
2012-04-04 13:23:41 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<sscrisk::cel::array<T, N> >::const_iterator begin(sscrisk::cel::array<T, N> const& cont) {
|
2012-03-31 07:24:13 +00:00
|
|
|
return typename sprout::container_traits<sscrisk::cel::array<T, N> >::const_iterator(cont, 0);
|
2011-10-11 15:38:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// cbegin
|
|
|
|
//
|
|
|
|
template<typename T, std::size_t N>
|
2012-04-04 13:23:41 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<sscrisk::cel::array<T, N> >::const_iterator cbegin(sscrisk::cel::array<T, N> const& cont) {
|
2012-04-03 12:58:23 +00:00
|
|
|
return typename sprout::container_traits<sscrisk::cel::array<T, N> >::const_iterator(cont, 0);
|
2011-10-11 15:38:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// end
|
|
|
|
//
|
|
|
|
template<typename T, std::size_t N>
|
2012-04-04 13:23:41 +00:00
|
|
|
inline typename sprout::container_traits<sscrisk::cel::array<T, N> >::iterator end(sscrisk::cel::array<T, N>& cont) {
|
2012-03-31 07:24:13 +00:00
|
|
|
return typename sprout::container_traits<sscrisk::cel::array<T, N> >::iterator(cont, cont.size());
|
2011-10-11 15:38:14 +00:00
|
|
|
}
|
|
|
|
template<typename T, std::size_t N>
|
2012-04-04 13:23:41 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<sscrisk::cel::array<T, N> >::const_iterator end(sscrisk::cel::array<T, N> const& cont) {
|
2012-03-31 07:24:13 +00:00
|
|
|
return typename sprout::container_traits<sscrisk::cel::array<T, N> >::const_iterator(cont, cont.size());
|
2011-10-11 15:38:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// cend
|
|
|
|
//
|
|
|
|
template<typename T, std::size_t N>
|
2012-04-04 13:23:41 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<sscrisk::cel::array<T, N> >::const_iterator cend(sscrisk::cel::array<T, N> const& cont) {
|
2012-03-31 07:24:13 +00:00
|
|
|
return typename sprout::container_traits<sscrisk::cel::array<T, N> >::const_iterator(cont, cont.size());
|
2011-10-11 15:38:14 +00:00
|
|
|
}
|
|
|
|
#endif
|
2011-09-01 02:48:32 +00:00
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_ADAPT_SSCRISK_CEL_ARRAY_HPP
|