How to determine if a class has no class deriving from it? Any type-traits methods help?
I want to write out some data. The data is created via a pointer like
unique_ptr<A> a(new A);
If class A has no sub-class, I just write out the data content. If A has subclasses, I will write out its concrete type first, and then write the data content. When reading the data, after reading the concrete type, I know using what concrete type to create the pointer and then read the data content. Thus, I think I have to determine if A has subclass or not?