C
christopher diggins
The following program doesn't work in gcc 3.3.3:
#include <cstdlib>
#include <iostream>
#include <sstream>
using namespace std;
void FuBar(const stringstream& s) {
cout << s.str() << endl;
}
int main(int argc, char *argv[])
{
FuBar(stringstream("hello"));
getchar();
return 0;
}
I get the message
`std::ios_base::ios_base(const std::ios_base&)' is private
Which really surprises me, because I don't understand why the copy
constructor should be called? Is this normal? What is the logic, why isn't
the temporary actually passed by reference?
#include <cstdlib>
#include <iostream>
#include <sstream>
using namespace std;
void FuBar(const stringstream& s) {
cout << s.str() << endl;
}
int main(int argc, char *argv[])
{
FuBar(stringstream("hello"));
getchar();
return 0;
}
I get the message
`std::ios_base::ios_base(const std::ios_base&)' is private
Which really surprises me, because I don't understand why the copy
constructor should be called? Is this normal? What is the logic, why isn't
the temporary actually passed by reference?