Boost logo

Boost :

From: Hartmut Kaiser (hartmutkaiser_at_[hidden])
Date: 2004-06-05 13:14:29


 
Reece Dunn wrote:

> I am implementing test cases to validate the implementation
> of my fixed_string class and basic_string_impl (based on
> flex_string) and noticed a defect in the implementation of:
>
> template< typename InputIterator >
> inline string_type & replace( iterator i1, iterator i2,
> InputIterator j1, InputIterator j2 );
>
> It handles the Integral case fine, but when the
> InputIterators are actually iterators, it asserts false,
> where the standard dictates it returns:
>
> replace( i1, i2, basic_string( j1, j2 ));
>
> or equivalent behaviour, e.g. in the implementation I'm using:
>
> replace( i1, i2, std::distance( j1, j2 ), char_type());
> std::copy( j1, j2, i1 );
>
> Is there any specific reason for this, or is it an implementation bug?

It's simply not implemented yet, I guess. Andrei (Alexandrescu) inserted an
assertion to draw the attention of the user to this fact. You may contact
him directly, maybe it's implemented already (the flex_string version
contained in Wave is a bit dated).

Regards Hartmut


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