FWD: Re: Your Message Sent on Sat, 29 Dec 2001 16:28:56 -0500
Jeffrey Turner
jturner@mail.alum.rpi.edu
Sat Dec 29 17:35:00 GMT 2001
---------- Original Message ----------------------------------
From: Bjarne Stroustrup <bs@research.att.com>
Reply-To: Bjarne Stroustrup <bs@research.att.com>
Date: Sat, 29 Dec 2001 16:51:06 -0500 (EST)
>Date: Sat, 29 Dec 2001 16:28:56 -0500
>Mime-Version: 1.0
>From: "Jeffrey Turner" <jturner@mail.alum.rpi.edu>
>To: <bs@day.research.att.com>
>
>Dear Mr. Stroustrup,
>
>This question came up recently on a gcc mailing list.
>Is there a C++ way to cast something to a void?
>Gcc will, reasonably enough give a warning for
>
> (void) foo
>
>if "-Wold-style-casts" is in the command-line.
>Can it be done with <xxxxxxx_cast>s?
Sure:
static_cast<void>(e);
is ok for any valid expression e. (standard 5.2.9[4])
>Thanks again,
>
>--Jeff Turner
>
>Who put the Sam in the "'Sama Laden Ding-Dong"?
>
- Bjarne
Bjarne Stroustrup, http://www.research.att.com/~bs
More information about the Gcc
mailing list