On 21 May 2008, at 15:28, Meir Yanovich wrote:
when im doing *Foo::iStream << c <<".\n";
im getting
error C2100: illegal indirection
I think this code is roughly equivalent to what you're trying to do,
and it compiles with both g++ and icc. Test if you can compile this,
if so your problem is somewhere else.
#include
#include <sstream>
#include <iostream>
#include <ostream>
class X
{
public:
static boost::shared_ptrstd::ostringstream x;
static void init_stream();
};
boost::shared_ptrstd::ostringstream X::x;
void X::init_stream() {
boost::shared_ptrstd::ostringstream temp(new std::ostringstream);
x.swap(temp);
}
int main() {
X::init_stream();
*X::x << "Hello" << std::flush;
std::cout << X::x->str() << std::endl;
return 0;
}