Article View: comp.std.c++
Article #3745Re: static_cast
From: linh (l.) dang
Date: Wed, 20 Mar 1996 03:18
Date: Wed, 20 Mar 1996 03:18
42 lines
2089 bytes
2089 bytes
>>>> "Matt" == Matt Austern <austern@isolde.mti.sgi.com> writes:
Matt> In article <314c3f47.1349350@nntp.ix.netcom.com>
Matt> jdmorris@ix.netcom.com (Jason D. Morris) writes:
>> Aren't the old C style casts and C++ functional style casts
>> depricated under the draft standard?
Matt> No. It's true that new-style casts (static_cast, dynamic_cast,
Matt> reinterpret_cast and const_cast) are almost always a better
Matt> solution, but old-style casts have not been deprecated.
Since static_cast is not always safe, did anyone consider a set of
implicit_cast<T> template functions as part of the standard library ?
e.g:
template<typename From, typename To>
inline To
implicit_cast(From x)
{
return x;
}
....
These functions are efficient, safe and might be the fatal blow to the
old-style cast.
--
L.D.
--
=====================================================================
Linh Dang Nortel Technology
Member of Scientific Staff Speech Recognition Software
linhd@nortel.ca
=====================================================================
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Technical Details
Message-ID:
<gkng2b584f4.fsf@bmtlh30.nortel.ca>Path:
arc1-ca.pugleaf.net!in1.uu.net!bounce-backShow Full Headers
Complete Article Headers
From: "linh (l.) dang" <linhd@bnr.ca> Message-ID: <gkng2b584f4.fsf@bmtlh30.nortel.ca> X-Original-Date: Tue, 19 Mar 1996 10:54:07 -0500 Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back Date: 20 Mar 96 03:18:49 GMT Approved: fjh@cs.mu.oz.au Return-Path: <daemon@meeker.UCAR.EDU> Subject: Re: static_cast Newsgroups: comp.std.c++ Organization: The entity formerly know as BNR X-Newsreader: Gnus v5.1 X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMU95NuEDnX0m9pzZAQFk7wGAhR/bAsituUBnJsBhgSfJZos69zsPj1Hf 74EXUVzr+mCYqH69UsAARk86KzNa3mzd =fvnw