From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-06-29 05:52:42
In message <003b01bfe176$018cf9f0$056ca8c0_at_[hidden]>, David
Abrahams <abrahams_at_[hidden]> writes
>I still favor my own suggestion - lexical_cast. interpret_cast is spelled
>way too much like reinterpret_cast, with which it has little in common.
>Also, lexical_cast is shorter ;)
Well, I reckon that interpret_cast and reinterpret_cast are sufficiently
far apart, and reflects the origins of the idea in scripting. However, I
must confess lexical_cast does have a nice ring to it and could quite
grow on me. Hmm, OK, lets call it lexical_cast -- anyone else want to
chip in $0.02 one way or another?
>> (2) For distinguishing between throwing and nonthrowing versions, I
>> tried out a few syntax forms, and found the following style one of most
>> convenient and "in the spirit":
>> a = interpret_cast<A>(b);
>> a = interpret_cast<A>(nonthrowing(b));
>> Whichever way we go, I would prefer to keep both forms as cast-like as
>> possible. Feelings on this?
>I don't see any advantage to this nonthrowing form over using std::nothrow
>as suggested in other posts.
Looks like a cast with a single operand.
>> If they are casts, which I would maintain they are, then I guess they go
>> with the other casts. Maybe it's just me, but I'm always faintly
>> suspicious of headers/directories/libraries that are called util or
>> utility: whilst not intrinsically a problem, they can end up as
>> repositories for almost anything that didn't fit any other
Kevlin Henney phone: +44 117 942 2990
Curbralan Ltd mobile: +44 7801 073 508
kevlin_at_[hidden] fax: +44 870 052 2289
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk