Boost logo

Boost Users :

Subject: Re: [Boost-users] [lexical_cast] Why isn't boost::lexical_cast bijective?
From: Egor Tensin (egor.tensin_at_[hidden])
Date: 2014-02-18 19:06:41


2 John: I wanted to convert a hexadecimal address string (like
"FFFFF880AABBCCDD") to void*. It works vice versa so why doesn't this
work this way?

2 Paolo: I don't know how to specify that the integer is in
hexadecimal form then.

Thank you all for your replies.

On Wed, Feb 19, 2014 at 1:55 AM, ÷ÉÔÁÌÑ áÓÔÁÐÏ×ÉÞ <gooddocteur_at_[hidden]> wrote:
> I think we use something like that in that case:
> long(boost::addressof(obj))?
>
> 2014-02-18 23:24 GMT+02:00 Paolo Bolzoni <paolo.bolzoni.brown_at_[hidden]>:
>
>> Perhaps using the integer value as address?
>>
>> On Tue, Feb 18, 2014 at 7:28 PM, John M. Dlugosz
>> <ngnr63q02_at_[hidden]> wrote:
>> > On 2/18/2014 11:17 AM, Egor Tensin wrote:
>> >>
>> >> Why this works:
>> >>
>> >> boost::lexical_cast<std::string>((void *) 42UL)
>> >>
>> >> and this throws:
>> >>
>> >> boost::lexical_cast<void*>(boost::lexical_cast<std::string>((void*)
>> >> 42UL))
>> >>
>> >> while converting void* to std::string and vice versa works perfectly
>> >> using std:: streams?
>> >>
>> >
>> > What is converting a std::string object to a void* supposed to mean?
>> >
>> >
>> > _______________________________________________
>> > Boost-users mailing list
>> > Boost-users_at_[hidden]
>> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net