Boost logo

Boost Users :

Subject: Re: [Boost-users] generate structs with all combinations of members from a given struct
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-01-30 12:39:34


On 01/30/10 07:35, Larry Evans wrote:
[snip]
>
> I think the following might work:
>
> step1:
> create sequence of fields:
> seq=(field1,field2,...,fieldn)
> step2:
> create a sequence of a sequence of fields by fold with pop_back:
> seq_fold=
> ( (field1,field2,....,fieldn)
> , (field1,field2,...,fieldn-1)
> ...
> , (field1)
> )
> step3
> form the cross product of seq_fold using code posted
> here:
>
[snip]

Nope, it wouldn't work since the number of generated elements
would be 4!, not the 2^4-1 required in the OP.

Sorry for noise.

-Larry


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net