On Friday, 14 February 2014 at 15:21:04 UTC, Jesse Phillips wrote:
On Friday, 14 February 2014 at 14:55:02 UTC, Robin wrote:
As far as I can imagine you could also implement ranges via
front and empty functions and ranges could easily expose their
variables as a getter method named front() or empty() and
nobody would care if it is handled functionally or via a
simple variable again.
FYI an infinite range is defined to have
struct Infinite {
enum empty = false;
}
You know it will never be empty at compile time.
Hiho,
thank you for this interesting input. =)
Couldn't this be equally possible (also at runtime) with the
following:
struct Infinite {
enum empty_ = false;
bool empty() pure { return empty_; }
}
?
Robin