Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2001-02-19 07:11:41

At the moment lexical_cast<string>(whatever) will fail if 'whatever' decides
to insert spaces in its representation. I think that it is not very
convenient. Is it reasonable to make casts to std::string special case,
returning stringstream::str()?

I haven't found discussion of this issue either in documentation or in
mailing list archive. It seems like implementing specialized behaviour is
quite simple (I actually done it), using auxillary functions:

template<class Target>
void lexical_cast_aux(Target&, std::stringstream&) {....}

void lexical_cast_aux(std::string&, std::stringstream&) {....}


Boost list run by bdawes at, gregod at, cpdaniel at, john at