Daily bit(e) of C++ | static operator()
Daily bit(e) of C++ ♻️97, Fixing function object deficiency using C++23 static operator().
C++23 addressed a long-standing problem with function objects.
Because the call operator() was not allowed to be a static method, function objects (even when stateless) couldn't be converted to function pointers, and each call to function object incurred the performance penalty of passing the "this" pointer.
With C++23, the operator() is allowed to be static, removing both issues.
Note that this did not affect lambdas, as non-capturing lambdas were always required to be convertible to a function pointer.