Help to understand what a class without data is, and where it can / should be used.

  • maybe you mean abstract class? - Semyon Shelukhin

2 answers 2

For example, a class without data members can define an interface for its derived classes. That is, such a class can contain only declarations of methods (virtual, non-virtual, static).

Or a class can be a container for some methods, most often static ones.

  • Now there is a tendency of library static functions to be located in classes. For example in js there is a class Math which contains mat-methods but does not contain data. - nick_n_a

Help to understand what a class without data is, and where it can / should be used.

Can be used in meta-programming. Although it is customary to use structures to implement the SFINAE paradigm.