Re: g++
AS> /******************************************************************************
AS> Strange thing, but this piece of code may initiate segfault
AS> near push_back in while. Is there an error in vector?
AS> gcc version 2.95.2 20000220 (Debian GNU/Linux)
AS> void f()
AS> {
AS> vector<string> paths;
AS> paths.push_back("1");
AS> cout << "loop..." << endl;
AS> vector<string>::iterator p = paths.begin();
AS> while (p != paths.end()) {
AS> cout << "\t" << *p << endl;
AS> paths.push_back(p, "2");
AS> ^^^^^^^^^^^^^^^^^^^^^^^^
должно быть так: paths.push_back("2");
но всё равно, на потате происходит segfault.
AS> this is the place of segfault
AS> ++p;
AS> }
AS> cout << "end..." << endl;
AS> }
AS> ******************************************************************************/
AS> Пишите, пожалуйста, в лист.
AS> --
AS> Андрей Сандерс
--
С уважением,
Александр Салтанов. <a href="mailto:asdgray@penza.net>
I'll receive your message at office</a>
--
To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to:
- Prev by Date:
g++
- Next by Date:
g++
- Previous by thread:
Re: g++
- Next by thread:
g++
- Index(es):