4 ms·
I so wish c++ would let me code like this without getting in the way with it's OOishness. Recent gripes: - got a few bit flags per struct, need to know if ther
by 112233 11y ago
I so wish c++ would let me code like this without getting in the way with it's OOishness. Recent gripes:
- got a few bit flags per struct, need to know if there is at least one instance with the flag set (a counter per flag). I cannot bit-pack the flags without duplicating the flag getter/setter/destructor code.
- no way to declare static linkage funcions as friends (the linkage is forced to external). so i need to expose types that are implementation detail in public header.
would be nice if c++ could get some RAD-slanted design work, instead of trying to get all RUSTy
- 112233 11y ago(expanding on the above while using non-touchscreen keyboard) The problem that I continually encounter writing data-first in c++ is the inability to group data members that are related to single implementation detail but are scattered in multiple classes, and indicating in a compiler-parsable way which functions have the responsibility to manage these data fields. For example, consider maintaining an M to N relation links between classes A an B, without putting links in parent class, and grouping all implementation details of these links in a a single file. Or even maintaining reference counter without using inheritance or other heavy-OO mentioned in the article. Even worse if your data is only a bitfield. C++ assumes single implementation detail to be a single class, contained in a single allocation. It can be subverted using "public", "friend", CRTP, but it feels like hammering nails with pliers. Newer standards go all-out on supporting really powerful data structures in library, and writing incredible templates, but there is nothing for low-level C-style custom data handling.