ENH: new IntRange class, enhancements to labelRange, sliceRange

- add reverse iterators and replace std::iterator
  (deprecated in C++17) with full definitions

- simplify construction of iterators

- construct labelRange from a single single parameter.
  This creates a (0,len) range.

- make basic constructors forms constexpr.
  Remove unused size checks.

- Derive labelRange from new IntRange template class.
  Allows reuse of base functionality with different integral sizes.

Deprecations:

  - deprecate labelRange::valid() in favour of using
    labelRange::empty() or the bool operator.
    For example,

        if (range) ...  vs older  if (range.valid()) ...

DEFEATURE: drop labelRange::null, scalarRange::null static variables

- turned out to be not particularly useful.
  Can simply use constexpr contructor forms

DEFEATURE: drop labelRange::identity static method

- simply use the single-parameter constructor
This commit is contained in:
Mark Olesen
2020-09-21 10:26:14 +02:00
parent ad8ac2fcd0
commit d204d33c4e
26 changed files with 2160 additions and 999 deletions

View File

@ -0,0 +1,3 @@
Test-IntRange.C
EXE = $(FOAM_USER_APPBIN)/Test-IntRange

View File

@ -0,0 +1,2 @@
/* EXE_INC = */
/* EXE_LIBS = */