Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder3.hal-mli.net!news.alt.net From: Keith Thompson Newsgroups: comp.std.c++ Subject: Why no "alignof unary-expression" like "sizeof unary-expression"? Date: Fri, 17 Jun 2011 13:15:39 CST Organization: None to speak of Lines: 23 Sender: std-cpp-request@vandevoorde.com Approved: stephen.clamage@oracle.com Message-ID: Content-Type: text/plain; charset=us-ascii To: undisclosed-recipients:; Return-Path: X-Original-Date: Thu, 16 Jun 2011 16:25:22 -0700 X-Submission-Address: std-c++-submit@vandevoorde.com Xref: x330-a1.tempe.blueboxinc.net comp.std.c++:166 The new alignof operator is followed by a parenthesized type-id, similar to the existing syntax for sizeof. But unlike sizeof, it can't be applied to a unary-expression. Why the restriction? (N1971, which appears to be the original proposal for alignof, shows a form "alignof ( constant-expression )", which apparently just yields the value of the expression (I haven't figured out why this would be useful). If that had survived, it could conflict with "alignof unary-expression". Is that the reason?) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister" [ comp.std.c++ is moderated. To submit articles, try posting with your ] [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]