Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-01-24 10:16:13


Peter Dimov wrote:
> I just wrote this:
>
> template<class V> std::string to_string(V const & v)
> {
> std::ostringstream os;
> os << v;
> return os.str();
> }
>
> template<> std::string to_string(std::string const & v)
> {
> return v;
> }
>
> for Nth time. Why don't we have this in Boost? And where should it go?

I'd say that

        lexical_cast<string>(some_value)

should do it (once it has specialization for string). Am I missing something?

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk