On Tue, Feb 14, 2017 at 07:14:08PM +0000, bachmeier via Digitalmars-d wrote:
> On Tuesday, 14 February 2017 at 19:08:53 UTC, bachmeier wrote:
>
> > I am not familiar with all of the past discussion of this issue, but
> > something that I have wondered is why we can't do something like
> >
> > alias fooConstraint = (s != SwapStrategy.stable
> > && isBidirectionalRange!Range
> > && hasLvalueElements!Range
> > && hasLength!Range
> > && Offset.length >= 1);
> >
> > Range remove
> > (SwapStrategy s = SwapStrategy.stable, Range, Offset...)
> > (Range range, Offset offset) if fooConstraint;
>
> I mean, is there some reason that this shouldn't be allowed? Any
> feature can be abused, but it looks useful in many cases.
This is already possible:
enum fooConstraint(R) = isBidirectionalRange!Range &&
hasLvalueElements!Range && ... ;
Range remove(SwapStrategy s, R)(...) if (fooConstraint!R) { ... }
T
--
"Maybe" is a strange word. When mom or dad says it it means "yes", but when my
big brothers say it it means "no"! -- PJ jr.