Open jensmaurer opened 4 years ago
How about renaming current to effective-current?
I'd like to avoid anything of the form "xxx-current"/"current-xxx" if we can. Now that all of the private variables have been kebab-cased, it's too easy to confuse the exposition only name foo-bar
with an expression that calculates the difference of the two exposition-only names foo
and bar
.
Ah, right. IIRC, the dash replaced underscores in exposition-only names to make that property more obvious. Now that they're kebab-cased, underscores should once again be viable.
One option would be to define current() as a pair of exposition-only member functions (const and non-const), and we could specify them precisely:
constexpr auto& current() {
if constexpr (forward_range<Base>)
return current_;
else
return parent_.current_;
}
The distinction between `current_ and _
current()`_ still isn't huge, but the parentheses would help.
Or there's always CURRENT
in the style of INVOKE
, but we've moved away from that to kebab-case.
Some misuse was fixed in #3849, but having these two near-identical identifiers with different semantics is prone to cause further mix-ups.
Find a better name for one of them.