stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: questions about the lib.alg.copy test
Date Thu, 01 Dec 2005 00:33:10 GMT
Anton Pevtsov wrote:
> I am porting the lib.alg.copy test to new test driver and I have a
> couple of questions about it:

Sorry I missed this email...

> 1. Current test version contains calls to to_string function and uses
> the tempstr class. This class is defined in the "test.h" header which
> should not be included into new test versions. Are these function and
> class obsolete or is tere a way to use them in new test versions?

Yes, the to_string() helper function is absent from the new driver.
There is no equivalent for class X, but the best way to handle it,
I think, is along the same lines as in 25.adjacent.find.cpp, i.e.,
use printable characters instead of integers as values for X.val_.
Then we can easily print out the sequence(s) in diagnostics.

> 2. The copy algorithm can work in case when the destination range
> overlaps the source range (of course, first position of the source range
> should not be contained in the destination range). Current version
> doesn't contain special test for this case, but I prefer to have such
> test. What do you think about it?

The requirement in 25.2.1, p3 is that "result shall not be in the
range [first, last)." The algorithm doesn't detect violations of
this requirement but it probably should in debug mode. This would
be a useful enhancement in general. Let me file an enhancement for


View raw message