This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiler warnings while compiling gcc with clangâ


On 5 May 2015 at 12:39, Aditya K wrote:
> There are however, other differences between class and struct (http://stackoverflow.com/a/999810/811335) i.e.,
>
> 1. In absence of an access-specifier for a base class, public is assumed when the derived class is declared struct and private is assumed when the class is declared class.

Yes, everyone here knows that. That is only relevant to the definition
of the class, which can only occur once. For the purposes of
declarations that are not definitions there is no difference.

> 2. class can be used in place of a typename to declare a template parameter, while the struct cannot.

Completely irrelevant in this context. The use of 'class' in a
template parameter list has nothing to do with struct or class types,
nor forward declarations of struct or class types.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]