Boost logo

Boost Users :

From: Miro Jurisic (macdev_at_[hidden])
Date: 2004-05-01 01:59:04


In article <upt9obwar.fsf_at_[hidden]>,
 David Abrahams <dave_at_[hidden]> wrote:

> Miro Jurisic <macdev_at_[hidden]> writes:
>
> > In article
> > <CF5A888BE3E8BC41AE0B18ABE60C4D47028DF6AB_at_[hidden]
> > >,
> > "DY, JERRY U (SBCSI)" <jd2419_at_[hidden]> wrote:
> >
> >> string s2 = lexical_cast<string>((int)c) // s2 = "65"
> >
> > I would have written int(c) instead of (int)c because compilers perform
> > more useful checking on the constructor than they do on the cast, but
> > that's all.
>
> The two forms are equivalent.

I have it in my head that I have seen a compiler that warned about int
construction from (for example) char*, but (obviously) not about a cast of char*
to int. I could be on crack, of course.

meeroh

-- 
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

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