C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Functions that don't need parentheses to make a call

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 24 Jul 2023 15:52:05 -0700
On Monday, 24 July 2023 15:31:18 PDT Frederick Virchanza Gotham via Std-
Proposals wrote:
> But, what if we could remove the preprocessor from the equation by
> providing a syntax for functions to take "void void" instead of
> "void"

The (void) argument is not native to C++ and only exists to keep compatibility
with C, which in turn invented it sometime between traditional K&R and C89 to
keep compatibility with B. Modern C++ code does not write (void). It's a
marker that whoever is writing that code is actually a C developer who is now
transitioning to C++. I'd advise against extending this and instead pretend it
doesn't exist.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-07-24 22:52:07