Comment by 3form

4 days ago

This looks great indeed - I wonder if there are any particular gotchas, though, as things often are in C++next land.

With many of the features coming into the language over time, I kinda wish that a bit more restricted subset of it eventually becomes a thing, but I know in practice it might as well be a completely different language. That, and I expect that still many other things have not been resolved as well as they are elsewhere, such as build system and dependency management (although I haven't touched this stack for a while now, so I would love to be surprised).

The gotcha is that this is a 90s C pattern, and software that actually needed this has been written for 3 decades by now

  • Sure, but this interface/implementation split is such a common pattern that it would be nice if the language handled it implicitly (NOT this std::indirect solution) rather than forcing the developer to use some explicit pimpl/handle pointer.

    You'd essentially like to derive a class/module implementation from it's corresponding class/module interface (which is all the user sees), but have the language automatically add a hidden "pimpl" pointer to the interface class. The implementation would then essentially use "this" to access public members, and "pimpl" for private members.