On Saturday, 16 April 2016 at 02:42:55 UTC, Andrei Alexandrescu
wrote:
So the constraint on chain() is:
Ranges.length > 0 &&
allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) &&
!is(CommonType!(staticMap!(ElementType, staticMap!(Unqual,
Ranges))) == void)
Noice. Now, an alternative is to
On Saturday, 16 April 2016 at 09:27:28 UTC, John Colvin wrote:
Very strong preference for the first. The second is so much
harder to read (not everyone is great at thinking recursively)
and also could depend on the implementation of chain if the
return type must be inferred from the body.
On 4/15/16 10:58 PM, Alex Parrill wrote:>
The only helper function you're getting rid of that I see is allSatisfy,
which describes the constraint very well.
staticMap, too. -- Andrei
On Saturday, 16 April 2016 at 02:42:55 UTC, Andrei Alexandrescu
wrote:
So the constraint on chain() is:
Ranges.length > 0 &&
allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) &&
!is(CommonType!(staticMap!(ElementType, staticMap!(Unqual,
Ranges))) == void)
Noice. Now, an alternative is to
On Saturday, 16 April 2016 at 03:46:25 UTC, Jonathan M Davis
wrote:
On Friday, April 15, 2016 22:42:55 Andrei Alexandrescu via
Pros? Cons? Preferences?
The first one is way cleaner IMHO.
- Jonathan M Davis
Strong preference for iterative, one key improvement of D's CTFE
vs legacy C++
On Friday, April 15, 2016 22:42:55 Andrei Alexandrescu via Digitalmars-d
wrote:
> So the constraint on chain() is:
>
> Ranges.length > 0 &&
> allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) &&
> !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) ==
> void)
>
> Noice. Now,
On Saturday, 16 April 2016 at 02:42:55 UTC, Andrei Alexandrescu
wrote:
So the constraint on chain() is:
Ranges.length > 0 &&
allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) &&
!is(CommonType!(staticMap!(ElementType, staticMap!(Unqual,
Ranges))) == void)
Noice. Now, an alternative is to
So the constraint on chain() is:
Ranges.length > 0 &&
allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) &&
!is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) ==
void)
Noice. Now, an alternative is to express it as a recursive constraint:
(Ranges.length == 1 &&