a) In your example, 2 instances of specialization are created.
b) There is no built-in method to support the number of specializations generated for a class. If in your project you can add a static quantity. If you want, you can write your own link counting mechanism for your class. Increase the static score in our constructor.
static int created = 0;
static int alive = 0;
class Test
{
counter()
{
created++;
alive++;
}
~counter()
{
created--;
}
};
source
share