3 ms·
> What Java code? A class with a passel of static member functions is Java code. It is not in any way idiomatic C++ code which has had namespace-level ("free")
by bregma 5mo ago
> What Java code?
A class with a passel of static member functions is Java code. It is not in any way idiomatic C++ code which has had namespace-level ("free") functions since it was invented as C-with-classes many decades ago. Using classes holding a whole lot of static member functions is strongly frowned on in the professional C++ community.
- pjmlp 5mo agoCertainly not the professional C++ comunity that still uses frameworks born in the 1990's predating Java, or game engines.
- dwrodri 5mo agoAuthor here: A lot of my professional C++ experience comes from the computer vision space where I am specifically linking against FFmpeg (libav does its own share of memory management tricks that don't always play well with RAII). I think of static functions (even within member classes) as a signifier of "hey, you don't need a constructed object for this to work and it doesn't depend on class instance state". In application code, I was typically relying on Myers Singletons and the implicit thread-safeness more than what you see here. I debated dropping the static keyword because it stands out as odd especially in a private class method, but settled on keeping it.