Maybe because it is commented out?
Please extract and post the minimal "compiling" example of the problem.
Also note that this kind of registration does not work well if the
TimerClass is a base class from which other classes are derived. The
problem is that in the base class constructor the object is not yet
complete and making an incomplete object accessible to other code via a
global structure may cause a bunch of nasty surprises (especially in a
multi-threaded program). Ditto for de-registration in the destructor.
Also, using raw pointers like that is seeking for troubles. Nowadays I
would use std::weak_ptr pointers in such registries instead.
hth
Paavo