Mail Archives: djgpp/1998/07/23/19:35:00
Well, this seems to be a bug in the complier or something.
I compile this peace of code w/ GXX v2.8.1 (and the updated libraries and
headers etc.. for 2.8.1) and it gives a SIGSEGV. Why is this? This should
be a perfectly usable piece of code. Something seems to be wrong w/ the
list header file or something.
____________________________________
#include <iostream>
#include <list>
#include <algorithm>
main()
{
list<int> l;
list<int> l2;
if(l.empty()) cout << "l :: OK\n";
if(l2.empty()) cout << "l2 :: OK\n";
l.push_front(10);
if(l.empty()) cout << "l :: Error\n";
list<int>::iterator p=find(l.begin(),l.end(),10);
if(p==l.end()) cout << "l :: Error\n";
l.splice(p,l2,l2.end());
if(l.empty()) cout << "l :: OK\n";
if(l2.empty()) cout << "l2 :: Error\n";
}
__________________________________
Why waste time learning
when ignorance is instantaneous?
--Hobbes
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
- Raw text -