Just looked up how to do callbacks in C++ and YOU CAN'T (unless you write a bunch of templates and wrappers yourself).
When you pass a pointer to non-static member function, yopu need to handle the class pointer yourself. This is like the simplest thing, why can't C++ have that?
Love how the ISO standard website just tells you "Don't". What a joke.
@sos@morten_skaaning Just not exactly what you expect. Pointer to member (data or function) allows to put a member in a variable, in order to dynamically select a member on a given object. So you can dynamically put a member in a variable auto mptr = &type::member then given an object, access that member, replacing object.member with object.*mptr. It's just a way to deffer or select dynamically members at runtime.
@sos@morten_skaaning The other answer would be of course "just use a lambda" because they work for pretty much all cases, even for C functions that can get a void*
So I spent a big chunk of my life living next door to Louisiana (Houston) and now I live next door to Quebec (Toronto) and it just this moment occurred to me to check if Quebec has beignets. Like, I'd simply assumed if I ever went liking for beignets I'd find them. So I asked a Quebecoise friend, and
Funny. I removed all modules from my C++ codebase (roughly 10% of it) and I got about 10-16% shorter compilation times. Not to mention Intellisense no longer crashing all over the place.
I wonder if it ever be a worthwhile feature to use.
@jakub_neruda the feature is not ready for prime time. Don't use it if the bleeding crashing edge is not your thing.
For compilation speed, it depends how fine grained your modules are. The smaller your modules are, the longer the compile time. They are not meant to replace headers 1:1. A good example is the STL, where any other splitting than just import std was found to be slower.
I'm still shaking. It was just like seeing a new color for the first time. It's impossible to explain how this felt. I'm truly grateful for this experience.