------- Comment #3 from lebedev at zhtw dot org dot ru 2006-11-03 15:29 -------
(In reply to comment #2) > Indeed, we badly need details. The correct output (which indeed I can see on > any machine I have at hand, any version of gcc) is: > 0 9 8 7 6 5 4 3 2 1 1 2 3 1 2 3 > 3 2 1 3 2 1 1 2 3 4 5 6 7 8 9 0 > This works well for me too on i386 freebsd-6.2-prerelease. But this happens under Tru64: [EMAIL PROTECTED]:~$ uname -a OSF1 axp3.umc8.mai.ru V5.1 2650 alpha [EMAIL PROTECTED]:~$ g++ --version g++ (GCC) 3.4.6 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [EMAIL PROTECTED]:~$ cat demo.cpp #include <iostream> #include <algorithm> #include <iterator> #include <string> int main() { std::string s = "0123456789"; std::copy(s.begin(), s.end(), std::ostream_iterator<char>(std::cout, " ")); std::cout << std::endl; std::copy(s.rbegin(), s.rend(), std::ostream_iterator<char>(std::cout, " ")); std::cout << std::endl; } [EMAIL PROTECTED]:~$ g++ demo.cpp [EMAIL PROTECTED]:~$ ./a.out 0 1 2 3 4 5 6 7 8 9 [EMAIL PROTECTED]:~$ ./a.out | od -h 0000000 2030 2031 2032 2033 2034 2035 2036 2037 0000020 2038 2039 0a0a 0000026 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29696