40#ifndef GEOGRAM_BASIC_RANGE
41#define GEOGRAM_BASIC_RANGE
76 return val_ == rhs.val_;
80 return val_ != rhs.val_;
84 return val_ < rhs.val_;
92 return val_ - it.val_;
119 ) : begin_(b), end_(e) {
143 return end_ - begin_;
153 return *(begin_ + i);
186 return ptr_ == rhs.ptr_;
190 return ptr_ != rhs.ptr_;
194 return ptr_ < rhs.ptr_;
197 const index_t& operator*()
const {
203 return index_t(ptr_ - it.ptr_);
247 return ptr_ == rhs.ptr_;
251 return ptr_ != rhs.ptr_;
255 return ptr_ < rhs.ptr_;
258 const index_t& operator*()
const {
269 return index_t(ptr_ - it.ptr_);
304 begin_(begin, begin, end),
305 end_(end,begin,end) {
342 begin_(begin, begin, end),
343 end_(end,begin,end) {
381 wrapped_(it), xform_(xform) {
384 auto operator*()
const {
385 return xform_(*wrapped_);
388 bool operator==(
const thisclass& rhs)
const {
389 return wrapped_ == rhs.wrapped_;
392 bool operator!=(
const thisclass& rhs)
const {
393 return wrapped_ != rhs.wrapped_;
396 bool operator<(
const thisclass& rhs)
const {
397 return wrapped_ < rhs.wrapped_;
421 wrapped_(it), xform_(xform) {
425 return xform_(*wrapped_);
428 const auto& operator*()
const {
429 return xform_(*wrapped_);
432 bool operator==(
const thisclass& rhs)
const {
433 return wrapped_ == rhs.wrapped_;
436 bool operator!=(
const thisclass& rhs)
const {
437 return wrapped_ != rhs.wrapped_;
440 bool operator<(
const thisclass& rhs)
const {
441 return wrapped_ < rhs.wrapped_;
466 typename RANGE::const_iterator, XFORM
470 wrapped_(range), xform_(xform) {
474 return iterator(wrapped_.begin(), xform_);
478 return iterator(wrapped_.end(), xform_);
507 typename RANGE::iterator, XFORM
511 typename RANGE::const_iterator, XFORM
515 wrapped_(range), xform_(xform) {
519 return iterator(wrapped_.begin(), xform_);
523 return iterator(wrapped_.end(), xform_);
551 template <
class RANGE,
typename XFORM>
inline auto
568 template <
class RANGE,
typename XFORM>
inline auto
A function to suppress unused parameters compilation warnings.
Assertion checking mechanism.
#define geo_debug_assert(x)
Verifies that a condition is met.
Encapsulates a const pointer to an element in an index_t array.
Wraps an integer to be used with the range-based for construct.
Encapsulates a pointer to an element in an index_t array.
A generic index_range bounded by two "non-iterators".
index_t nb() const
gets the number of elements in the index_range
index_as_iterator end() const
gets one position past the last index
index_range(index_as_iterator b, index_as_iterator e)
index_range constructor
index_t operator[](index_t i) const
direct access to an arbitrary element in the index_range
index_as_iterator begin() const
gets the first index
Vector with aligned memory allocation.
T * data()
Gets a pointer to the array of elements.
Types and functions for memory manipulation.
Global Vorpaline namespace.
auto transform_range_ref(const RANGE &range, XFORM xform)
Creates a range that applies a user-defined function to each element when accessed.
void geo_argused(const T &)
Suppresses compiler warnings about unused parameters.
auto transform_range(const RANGE &range, XFORM xform)
Creates a range that applies a user-defined function to each element when accessed.
geo_index_t index_t
The type for storing and manipulating indices.
Types and functions for numbers manipulation.