B
ben
Is istream_iterator<> and ostream_iterator<> supposed NOT to be included in
<iostream>? The following example compiles in VC 7.1 but not with gcc 3.4.3
#include <iostream>
#include <deque>
#include <algorithm>
int main()
{
using namespace std;
deque<int> ls;
copy(istream_iterator<int>(cin), istream_iterator<int>(),
back_inserter(ls));
sort(ls.begin(), ls.end());
copy(ls.begin(), ls.end(), ostream_iterator<int>(cout));
return 0;
}
ben
<iostream>? The following example compiles in VC 7.1 but not with gcc 3.4.3
#include <iostream>
#include <deque>
#include <algorithm>
int main()
{
using namespace std;
deque<int> ls;
copy(istream_iterator<int>(cin), istream_iterator<int>(),
back_inserter(ls));
sort(ls.begin(), ls.end());
copy(ls.begin(), ls.end(), ostream_iterator<int>(cout));
return 0;
}
ben