What could be the possible advantages/uses of having an empty class?
P.S: This question might sound trivial to some of you but it is just for learning purpose and has no practical significance. FYI googling didn't help.
What could be the possible advantages/uses of having an empty class?
P.S: This question might sound trivial to some of you but it is just for learning purpose and has no practical significance. FYI googling didn't help.
For the sake of typeid
Suppose we have comparable interface Id. We need fill some container with unique instances of this interface. How to guarantee the uniqueness of Id instances produced by independent software parts? «Independent parts» means some different dynamic libraries, compiled by different programmers from different locations
One of decisions is to compare typeid of some type first. If typeid matches, convert and compare other implementation specific properties. C++ language guarantees uniqueness of any type within process memory. Which type should be used for this purpose? Any type with minimum resource consumption — empty one