pilotclient
pilotclient copied to clipboard
CLogCategoryList easier to construct in static member functions
The normal use case of CLogMessage and CStatusMessage involves implicit construction of the CLogCategoryList from the caller's this pointer. The value of the pointer doesn't matter, only its type is used to obtain the categories by reflection.
Obviously this is not available in static member functions. Currently there are two workarounds:
- Just call the static
getLogCategories(), which is incorrect (doesn't use reflection). static_cast<Class*>(nullptr), which is correct but cumbersome.
We need a better way to construct a CLogCategoryList for a class, without access to a this pointer.