>From: "Terje Slettebų" <[EMAIL PROTECTED]>

> >From: "Early Ehlinger" <[EMAIL PROTECTED]>
>
> > std::stringstream temp;
> > temp << source;
> > return TargetType( temp.str().c_str() );
> >
> This exact solution would work as long as the other string-types
implements
> the c_str() member function, like std::string.

Oops, I misread the code. This would work for any target type that has a
constructor which accepts a (const) char *. This is a good suggestion, and
it's kind of an extension to Gennadiy's proposal
(http://groups.yahoo.com/group/boost/files/lexical_cast_propositions/proposi
tion1.cpp), which constructs the stringstream directly from a string, if the
_source_ is a string. Your proposal covers if the _target_ is a string. I
was going to add Gennadiy's proposal, and I'll add yours, as well. Thanks
for the suggestion.


Regards,

Terje

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to