Subject: Re: [boost] Assign V2 - first impression
From: er (er.ci.2020_at_[hidden])
Date: 2011-06-24 16:18:13


> Now if you want to repeat the operation of inserting the element f( x ),
> I'm not sure how you do that with Range, but with V2, after learning the
> syntax, it's relatively straightforward:
>
> ( put_front<1>( cont ) % ( _data = f ) % ( _repeat = n ) )( 1, 10, 100,
> 1000 );
>

This was suggested, which is probably the best:

push_front<1>( cont , _data = f, _repeat = n )( 1, 10, 100, 1000 );

More generally,

// Fixed arity:
push_front<I>( cont , options... )( a1,...,aI,...,z1,...,zI );

// Variadic
push_front( cont , options... )( args1 )...( argsn );

where in each case (fixed and variadic), options... modify the semantics
of the subsequent calls to operator().