C++ Logo

std-proposals

Advanced search

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

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Tue, 25 Jul 2023 00:04:23 +0100
On Mon, Jul 24, 2023 at 11:52 PM Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> 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 was a C++ programmer before I was a C programmer, and still I use
'void' as a parameter list. I wish it had been enforced back in C++98
so that:
    MyClass obj();
would have been interpreted as an object declaration rather than a
function declaration. Obviously it's a moot point now since C++11 gave
us {} for initialisation.

I like the verbosity of (void) and you'll find it everywhere in my
code. Let's not get too hung up on coding styles though.

Received on 2023-07-24 22:57:55