[Joke] C++ and D namings
H. S. Teoh
hsteoh at quickfur.ath.cx
Wed Jan 20 01:30:15 UTC 2021
On Wed, Jan 20, 2021 at 01:17:36AM +0000, Meta via Digitalmars-d wrote:
> On Wednesday, 20 January 2021 at 01:04:07 UTC, Andrei Alexandrescu wrote:
> > On 1/19/21 4:50 PM, Q. Schroll wrote:
> > > In C++, the noexcept specifier means you cannot throw anything.
> > > In D, the nothrow specifier means you cannot throw Exceptions,
> > > but anything else.
> >
> > Except that in C++, noexcept really means you can throw anything but
> > you're not supposed to. Important distinction...
:-D
> I've never understood why that is. Do you have any insight into why
> noexcept is so useless? Why was it designed that way?
I'm not the least surprised. After all, this is C++, the same language
that lets you write 'const' on something, and then in the same breath
write 'const_cast<...>' to pretend that you never wrote it, all the
while your caller still believes that you're honoring your word on the
'const'.
Nothing new under the sun. ;-)
T
--
The most powerful one-line C program: #include "/dev/tty" -- IOCCC
More information about the Digitalmars-d
mailing list