incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <Ant...@moscow.vdiweb.com>
Subject RE: basic_string::insert (iterator p, InputIterator first, InputIterator last) on Linux, gcc-4.0.2
Date Mon, 03 Apr 2006 15:45:47 GMT
Hi Liviu,

Liviu Nicoara wrote:
> What kind of a build was this? Is the testing infrastructure needed to
exhibit the problem or you just used it for convenience in printing the
results?
It was 11s build (I built without specifiyng the build type, so it
should be 11s by default). 
I just used the testing infrastructure for convenience here. 


Thanks,
Anton Pevtsov


-----Original Message-----
From: Liviu Nicoara [mailto:nicoara@roguewave.com] 
Sent: Monday, April 03, 2006 19:40
To: stdcxx-dev@incubator.apache.org
Subject: Re: basic_string::insert (iterator p, InputIterator first,
InputIterator last) on Linux, gcc-4.0.2


Hi Anton,

What kind of a build was this? Is the testing infrastructure needed to
exhibit the problem or you just used it for convenience in printing the
results?

- Liviu

Anton Pevtsov wrote:
> The basic_string::insert (iterator p, InputIterator first, 
> InputIterator
> last) doesn't work correctly on Linux for string str when
> first = str.begin() + 1, last = str.begin() + 3.
> 
> This code illustrates the problem:
> 
> #include <rw_printf.h>  
> #include <rw_char.h>    
> 
> #include <string>
> #include <cstddef>
> 
> int main (void)
> {
>     typedef std::basic_string <char, std::char_traits<char>, 
>          std::allocator<char> > TestString;
> 
>     char test[] = "abcdef";
>     char exp_test[] = "bcabcdef";
> 
>     TestString s (test, 6);
>     s.insert (s.begin (), s.begin () + 1, s.begin () + 3);
> 
>     rw_printf ("this (%{#*s})->insert (*this.begin (), "
>                "*this.begin () + 1, *this.begin () + 3) "
>                " == %{#*s}, got %{#*s}\n", 
>                6, test, 8, exp_test, int (s.size ()), s.c_str ());
> 
>     return 0;
> }
> 
> 
> The output is
> this ("abcdef")->insert (*this.begin (), *this.begin () + 1,
*this.begin
> () + 3)  == "bcabcdef", got "baabcdef"
> 
> On Windows the output is:
> this ("abcdef")->insert (*this.begin (), *this.begin () + 1, 
> *this.begin
> () + 3)  == "bcabcdef", got "bcabcdef"
> 
> Martin, could you look into this when you have a chance, please?
> 
> If you reproduce the problem I'll open the jira issue and try to 
> investigate the cause.
> 
> 
> Thanks,
> Anton Pevtsov
> 


Mime
View raw message