News for hackers. Stuff that matters.
Re:The use of `class` for things that should be simple free ... by Huperniketes on Thursday May 28, 2020 @08:59PM (#23345119)
> Even C++ lets you store the address of the member function and lets you invoke it with an instance later.

Not for virtual member functions (not that I've been able to find). C++ is geared towards generating optimal executables. Since the type of the object is known at compile-time, the particular function used for that type is known, and the compiler will generate code that applies for it.

This is why C++ uses mangled names: to discriminate between identically named functions of different types and signatures.

There are no comments on this comment yet.