Boost logo

Boost :

Subject: Re: [boost] [lexical_cast] Error casting void* to std::string
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2011-11-24 13:16:23


2011/11/24 GMan <gmannickg_at_[hidden]>:
> In my mind, lexical_cast is a nicer/safer/optimized version of a
> std::stringstream cast. That is, in the case of no errors
> lexical_cast<R>(x) has the same result as:
>
> template <typename S>
> R lexical_cast_exposition(const S& x) // assumes no errors
> {
>    std::stringstream ss;
>    ss << x;
>
>    R y;
>    ss >> y;
>
>   return y;
> }
>
>
> In my case, S is void* and R is std::string (and it uses ostream&
> operator<<(const void*)).

Great thanks for reporting this bug. Ticket is already crated(#6132)
I`ll try to fix it till next release.

Best regards,
Antony Polukhin


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