3 ms·
Why? I do not find the syntactic sugar C++ adds very helpful and it misses other C features.
by uecker 2y ago
Why? I do not find the syntactic sugar C++ adds very helpful and it misses other C features.
- ryao 2y agoPerhaps he wants to jump through hoops to avoid function pointers, even when doing that in C++ for optional functions like is done in the VFS requires gymnastics: https://godbolt.org/z/4GWdvsz6z https://godbolt.org/z/4GWdvsz6z That is the closest I can get it to implementing an optional function via a C++ class member function instead of a function pointer. It is not only insane, but also masochistic in comparison to how it would be done via function pointers: https://godbolt.org/z/qG3v5zcYc https://godbolt.org/z/qG3v5zcYc