Boost logo

Boost Users :

From: Hansi (hansipet_at_[hidden])
Date: 2008-05-27 09:06:14


Alexander Nasonov schrieb:
> Hansi <hansipet <at> web.de> writes:
>
>> It works now for pointers too, but now I have the problem with the char
>> type. First I have made a specialization for this type. Is it here also
>> possible to make only one specialization or have I to provide both for
>> pointer and value?
>
> I wonder what your Validator validates? You seem to be mixing values and
> pointers which is not a good idea.

At the moment I mix references and pointers. I know that it would be
better to not use pointers. But there are cases where it is easier to
use it. In this cases it is allways != NULL
There are made a few more checks with the validator (ranges, possible
values e.g.).

>
> BTW,
>
> http://www.boost.org/doc/libs/1_35_0/libs/conversion/lexical_cast.htm#changes
>
> "The previous version of lexical_cast allowed unsafe and meaningless
> conversions to pointers. The current version now throws a bad_lexical_cast for
> conversions to pointers: lexical_cast<char *>("Goodbye, World") now throws an
> exception instead of causing undefined behavior."
>
> --
> Alexander


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