News for hackers. Stuff that matters.
Re:Overview: What are Cpp2 and cppfront? How do I get and bu... by Findecanor on Sunday March 31, 2024 @07:04PM (#39889028)
Yes, you can have a private virtual member function, and it can be overridden in a child class (unless declared final), apparently.

I too thought that sounded insane, so I just looked it up. I've been programming C++ for twenty five years and the thought of wanting to do this have never ever occurred to me...

Re:Overview: What are Cpp2 and cppfront? How do I get and bu... by AnimalMuppet on Sunday March 31, 2024 @08:13PM (#39889513)
TIL.
Re:Overview: What are Cpp2 and cppfront? How do I get and bu... by usefulcat on Sunday March 31, 2024 @11:45PM (#39890732)
It could make sense if you have a method that you want derived classes to be able to override but not to be able to call directly.

This is, admittedly, a pretty niche case but certainly not inconceivable.

Re:Overview: What are Cpp2 and cppfront? How do I get and bu... by zetafunction on Monday April 01, 2024 @12:12AM (#39890856)
Except the derived class can simply change the visibility of the override, so...