4
440gtx
The class keyword created a lot of confusion that resulted in a popular
style that says struct is appropriate for POD (plain old data) and
class is appropriate for fancier things (member functions, data hiding,
inheritance). And indeed the FAQ even advocates this usage model. I
myself have broken from this tradition because I find the public
defaulting of struct more appropriate than class and thus prefer it
100% of the time. The benefit is I no longer need to unhide the
constructor and I don't lose any explicit control over privacy. So what
was the reason for introducing the class keyword?
style that says struct is appropriate for POD (plain old data) and
class is appropriate for fancier things (member functions, data hiding,
inheritance). And indeed the FAQ even advocates this usage model. I
myself have broken from this tradition because I find the public
defaulting of struct more appropriate than class and thus prefer it
100% of the time. The benefit is I no longer need to unhide the
constructor and I don't lose any explicit control over privacy. So what
was the reason for introducing the class keyword?