I have a base class that takes a string to its constructor. I want to
construct a concrete class that does this:
class concrete: public base
{
public:
concrete() : base( /* create a stringstream here and convert to
string */ ){}
};
However, I can't get it to work. I can pass this:
ostringstream(" String").str()
but not this:
(ostringstream( "String") << 3).str()
or this:
((ostringstream )(ostringstream ("String") << 3)).str()
which is what I want to do (as I need to build the string on the fly.
What do I do?
construct a concrete class that does this:
class concrete: public base
{
public:
concrete() : base( /* create a stringstream here and convert to
string */ ){}
};
However, I can't get it to work. I can pass this:
ostringstream(" String").str()
but not this:
(ostringstream( "String") << 3).str()
or this:
((ostringstream )(ostringstream ("String") << 3)).str()
which is what I want to do (as I need to build the string on the fly.
What do I do?
Comment