
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 <boost/shared_ptr.hpp> #include <sstream> #include <iostream> #include <ostream> class X { public: static boost::shared_ptr<std::ostringstream> x; static void init_stream(); }; boost::shared_ptr<std::ostringstream> X::x; void X::init_stream() { boost::shared_ptr<std::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; }