OK I had read some article recently which said like :
Every name declared in c++ has type associated with it. e.g
int a; //type of a int
void foo(); //type is void(*)()
class bar; //what is type of bar here then ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesn’t have a “type” in the traditional sense, but rather, is a type. While in some languages like Ruby or Objective-C, classes are objects (objects of class
Class), in C++, classes have no type beyond being a type. They do have an associatedtype_info, but that is not the class itself, rather just some information that must be accessed throughtypeid.baris not of typebar.baris not even an object. Bar is a type, which, as said before, in C++, have no type.