Re: C++: std::ostringstream default ctor problems
Re: C++: std::ostringstream default ctor problems
- Subject: Re: C++: std::ostringstream default ctor problems
- From: Dan Caugherty <email@hidden>
- Date: Mon, 28 Sep 2009 21:06:49 -0400
Hi Howard (& every1 else):
Well, the base class of foobar does declare a virtual dtor, so no luck there.
I should also mention that foobar is actually an instantation of a
template.. let's call it foobar<T>.
(I omitted that detail thinking it was irrelevant, but now, who knows?)
I'll duly note the remark about 'const std::string'; thanks for the heads-up.
Strangely enough, I never had this problem with GCC 4.0. Now I have
the following lines
in place:
template <typename T>
foobar<T>::to_string() const
{
std::string s(1, '\0') //HACK!!!!
std::ostringstream oss(s);
oss << item(); //item() returns an instance of a T, BUT it will blow
up if T is a base type such as int.
return oss.str();
}
Cheers,
-- Dan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden