Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson<kst-u@mib.org> |
|---|---|
| Newsgroups | comp.std.c++ |
| Subject | Why no "alignof unary-expression" like "sizeof unary-expression"? |
| Date | 2011-06-17 13:15 -0600 |
| Organization | None to speak of |
| Message-ID | <lnvcw51hr1.fsf@nuthaus.mib.org> (permalink) |
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<http://www.ghoti.net/~kst>
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 ]
Back to comp.std.c++ | Previous | Next | Find similar
Why no "alignof unary-expression" like "sizeof unary-expression"? Keith Thompson<kst-u@mib.org> - 2011-06-17 13:15 -0600
csiph-web