News for hackers. Stuff that matters.
Re:F() vs. F(void) in C vs. C++ by pdpi on Sunday May 12, 2019 @06:44PM (#19895079)
> Is an error in C, but surprisingly C++ is less strict here, not only allowing it but also taking the semantics of the definition. (Spooky)

Aren't these just declaring one overload of foo and defining a different overload?

Re:F() vs. F(void) in C vs. C++ by hermitdev on Sunday May 12, 2019 @07:36PM (#19895316)
Yeah, it's an overload as others have replied. The difference between C and C++ here, is that you should get a linker error if you try and invoke the undefined overload in C++ (C doesn't allow overloading, nor does it require a forward declaration).

This is how we "deleted" functions, especially otherwise auto generated ones such as a default or copy constructor and assignment operator pre C++11.

Re:F() vs. F(void) in C vs. C++ by Thorrez on Sunday May 12, 2019 @06:51PM (#19895110)
Yeah, there's nothing spooky there. C++ supports overloads and C doesn't.
Re:F() vs. F(void) in C vs. C++ by ndesaulniers on Sunday May 12, 2019 @07:15PM (#19895225)
Ah! That's it, thanks! edited the article
Re:F() vs. F(void) in C vs. C++ by J-Kuhn on Sunday May 12, 2019 @07:40PM (#19895334)
Came here to say something that I suspect operator overloadíng. I read your comment, pressed refresh, and it was already fixed.