mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
add make_ptr_range overload
This commit is contained in:
parent
8a92528261
commit
28697ee7a8
1 changed files with 10 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/ptr_index_iterator.hpp>
|
||||
#include <sprout/range/range_container.hpp>
|
||||
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
|
||||
|
||||
namespace sprout {
|
||||
namespace range {
|
||||
|
@ -21,6 +22,15 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::range::range_container<sprout::ptr_index_iterator<T> >
|
||||
make_ptr_range(T* first, T* last) {
|
||||
return sprout::range::range_container<sprout::ptr_index_iterator<T> >(
|
||||
sprout::ptr_index_iterator<T>(first),
|
||||
sprout::ptr_index_iterator<T>(first, NS_SSCRISK_CEL_OR_SPROUT::distance(first, last))
|
||||
);
|
||||
}
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
inline SPROUT_CONSTEXPR sprout::range::range_container<sprout::ptr_index_iterator<T> >
|
||||
make_ptr_range(T (& arr)[N]) {
|
||||
|
|
Loading…
Reference in a new issue