Search code examples
c++objective-cobjective-c++

What is the most basic class in C++


I hope this question is not too silly, but what is the most basic class in standard C++? object? Object?

class MyObject : public object{  ...

and I get "Expected class-name before token{"

Is there any map, diagram or image that shows standard c++ classes inheritance? Something like this but for C++ ?


Solution

  • In Cocoa, the NSObject class is fundamental to the framework but not to the Objective-C language itself. In Objective-C, it is possible to create a root class by not deriving from anything (but in order to make it work you'll probably have to hack your way through runtime calls).

    Similarly, some C++-based frameworks may define a root class that all other classes in that framework derive from, but it is specific to the framework, not the language.