Hello dear! Tell me please.
For example, we have some kind of class factory system. It is required that as soon as we execute include of some such class, which should be in the list of the factory, it registers itself in this factory.
those. let the factory be a static array of pointers. As soon as we execute include, the module itself creates an object and adds it to this sheet. How can I do that?
in pascale (Delphi) the module had such a wonderful section as initialization. Here you need something like an analogue. It is desirable to stat and analog, but caused when the module is disconnected (it is called, respectively, when the program ends)
Tell me please