On Thu, Mar 31, 2016 at 07:43:38PM +0200, ag0aep6g via Digitalmars-d-learn
wrote:
> On 30.03.2016 20:12, jmh530 wrote:
> >I wrote a version of cartesianProduct that will return the cartesian
> >product when the some of the types are not ranges. The original code
> >is below.
> >
> >My issue is
On 30.03.2016 20:12, jmh530 wrote:
I wrote a version of cartesianProduct that will return the cartesian
product when the some of the types are not ranges. The original code is
below.
My issue is that I can't figure out how to turn it into a variadic
template. The latest thing I tried is:
auto
On Thursday, 31 March 2016 at 10:27:41 UTC, Artur Skawina wrote:
auto mixedCartesianProduct(T...)(T x)
{
import std.range, std.algorithm : cartesianProduct;
return
mixin(`cartesianProduct(`~iota(T.length).map!`"conditionalOnly(x["~text(a)~"])"`().join(",")~`)`);
}
On 03/30/16 20:12, jmh530 via Digitalmars-d-learn wrote:
> I wrote a version of cartesianProduct that will return the cartesian product
> when the some of the types are not ranges. The original code is below.
>
> My issue is that I can't figure out how to turn it into a variadic template.
>
On Wed, Mar 30, 2016 at 08:43:03PM +, jmh530 via Digitalmars-d-learn wrote:
> On Wednesday, 30 March 2016 at 18:56:29 UTC, H. S. Teoh wrote:
> >
> >Does this do what you want?
> >
>
> Okay, I've looked at this a bit more thoroughly and it works perfectly
> (perhaps with a better name put in
On Wednesday, 30 March 2016 at 18:56:29 UTC, H. S. Teoh wrote:
Does this do what you want?
Okay, I've looked at this a bit more thoroughly and it works
perfectly (perhaps with a better name put in phobos?).
If I'm understanding this correctly, the ImplType creates the
correct type
On Wednesday, 30 March 2016 at 18:56:29 UTC, H. S. Teoh wrote:
Does this do what you want?
I think it does. That's an approach I would not have thought of.
I do not really know much about AliasSeq.
On Wed, Mar 30, 2016 at 06:12:40PM +, jmh530 via Digitalmars-d-learn wrote:
> I wrote a version of cartesianProduct that will return the cartesian
> product when the some of the types are not ranges. The original code
> is below.
>
> My issue is that I can't figure out how to turn it into a
I wrote a version of cartesianProduct that will return the
cartesian product when the some of the types are not ranges. The
original code is below.
My issue is that I can't figure out how to turn it into a
variadic template. The latest thing I tried is:
auto mixedCartesianProduct(T...)(T x)