Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-02-08 14:51:08


Thorsten Ottosen wrote:
> Dear all,
>
> I'm working on getting the indirect container library (former smart
> container lib) ready for a post-review.
>
> During the review it was decided to provide overloads of
> assign(), insert() etc that takes a Range instead of two iterators.
>
> That is often a problem because of multiple overloads, that is,
> we get ambiguity. Basically I think we got two alternatives:
>
> 1.
> template< class Iter >
> void container::assign( const iterator_range<Iter>& );
> ...
> container c;
> c.assign( make_iterator_range( some_range ) );
>
> 2.
>
> template< class Range
> void container::assign_range( const Range& ):
> ....
> container c;
> c.assign_range( some_range );
>
> Which one do you prefer?

I definitely prefer "assign" to "assign_range". Could you say more explcitly
what the ambiguity would be if you try to make assign and insert to too much
work?

Jonathan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk