[vsipl++] [selgen]

Jules Bergmann wrote:
> Looks good. I have one suggestion for indexbool to make it a little
> more robust, otherwise it looks ready to check in.
>> Also, were the unit tests included in the patch?
Oups, that was a new file, and thus it wasn't part of the diff.
I attach it now for the record.
> In the short term, let's check that cursor is less than indices.size()
> before doing the put, i.e.:
>> index_type cursor = 0;
> for (index_type i = 0; i != source.size(); ++i)
> if (source.get(i) && cursor++ < indices.size())
> indices.put(cursor-1, Index<1>(i));
> return cursor;
>> The returned value (cursor) is still the "number of non-false values in
> source" (as required by the spec) and we avoid overwriting memory. A
> concerned user can check if the returned value is greater than
> indices.size().
Done.
> Why are clip_functor and invclip_functor nested in clip_wrapper? (I'm
> just curious, I'm not suggesting that it should be changed)
The Unary_expr_block harness expects a functor that is a class template
taking a single parameter. As here we have three, I put the two additional
parameters in the outer 'wrapper' template. I'm looking forward to times
when template typedefs become available. :-)
The patch is checked in now.
Regards,
Stefan