N
Nick Keighley
Hi,
I'm having problems with stringstream, specifically it won't compile
with Visual C++ 2008 Express. This may be a problem with CPPX, in
which case I'll go elsewhere (suggestions?). But is there an obvious
bug with this code?
#include <iostream>
#include <sstream>
class Lexer
{
public:
explicit Lexer (std::istream&);
~Lexer ();
private:
std::istream stream_;
};
Lexer::Lexer (std::istream& in_stream):
stream_(in_stream)
{
}
Lexer::~Lexer ()
{
}
int main ()
{
std::istringstream in_stream ("purple people eater");
Lexer lex (in_stream);
return 0;
}
The diagnostic is:
c:\program files\microsoft visual studio 9.0\vc\include\istream(846) :
error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot
access private member declared in class
'std::basic_ios<_Elem,_Traits>'
1>
it sems to be claiming a bug in istream, which doesn't sound good...
thanks,
Nick Keighley
I'm having problems with stringstream, specifically it won't compile
with Visual C++ 2008 Express. This may be a problem with CPPX, in
which case I'll go elsewhere (suggestions?). But is there an obvious
bug with this code?
#include <iostream>
#include <sstream>
class Lexer
{
public:
explicit Lexer (std::istream&);
~Lexer ();
private:
std::istream stream_;
};
Lexer::Lexer (std::istream& in_stream):
stream_(in_stream)
{
}
Lexer::~Lexer ()
{
}
int main ()
{
std::istringstream in_stream ("purple people eater");
Lexer lex (in_stream);
return 0;
}
The diagnostic is:
c:\program files\microsoft visual studio 9.0\vc\include\istream(846) :
error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot
access private member declared in class
'std::basic_ios<_Elem,_Traits>'
1>
it sems to be claiming a bug in istream, which doesn't sound good...
thanks,
Nick Keighley