From 2288358247233595600
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,857007135a18bc05,start
X-Google-Attributes: gidf78e5,public
From: m-morita@trc.rwcp.or.jp (Masao Morita)
Subject: static_cast to void
Date: 1999/09/09
Message-ID: <M-MORITA.99Sep9141115@pdss7.trc.rwcp.or.jp>#1/1
X-Deja-AN: 523083135
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
X-Original-Date: 09 Sep 1999 05:11:15 GMT
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: ariel.ucs.unimelb.edu.au 936906301 4032 128.250.37.153 (9 Sep 1999 19:45:01 GMT)
Organization: Tsukuba Research Center, Real World Computing Partnership, JAPAN
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN9gOM+EDnX0m9pzZAQG7awF+Nbd8yq4E3pWaoGkBzuRWjBzK0KhDFo4F Wsxro4/60NtNNJVd5s2hbMsMzCrlrqir =Lcq2
NNTP-Posting-Date: 9 Sep 1999 19:45:01 GMT
Newsgroups: comp.std.c++

Hi,
   I have a question about static_cast expression.
ISO/IEC 14882:1998(E) 5.2.9 static_cast paragraph 4
4 Any expression can be explicitly converted  to  type "cv  void."   The
  expression  value  is discarded.  [Note: however, if the value is in a
  temporary variable, the destructor for that  variable  is not executed
  until the usual time, and the value of the variable is preserved for
  the purpose of executing the destructor.  ]

I can not understand this paragraph.
Say.

    static_cast<void>(Any_Expression);

This expression looks like meaningless.
Probably, the content of Any_expression would make sence in any case.
what sort of case?

If possible, please show me examples.
Thank you in advance.

M. Morita
---
[ 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    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



