I am a beginner of c++ and I read google style guide. It suggests followings about interface class.
- It has only public pure
virtual
("= 0")methods
- It may not have
non-static
data members.
I would like to know the reasons why it suggests
- (a) interface class should not have default function and
- (b) non-static data member? About question (b), is it related to initialization of class or serialization?
And this is more trivial and personal question,
- (c) if I call "
mix-in
" class as "protocol
" class personally, do you think of any problems? I try to name my mix-in classes with a marking name, like "Interface
" in "ClassInterface
", which is suggested by google style guide. "mix-in
" class is not intuitive for me although I would like to show my respects to the name. "protocol
" is intuitive for me because it is a kind of processes which are shared by players.
If someone knows the reasons or has any opinions. Please let me know them. Thank you very much.