When I try to compile this, it complains that System and String are not declared. How do you do to make the main function work? Is the array syntax right?
While we're on the subject of standard C++, I've always had the question about Qt. It's pretty common to use:
1 2 3 4 5
class SomeClass : QSomeOtherClass
{
private slots:
someSlot();
};
private slots: doesn't seem like standard C++, but is there perhaps a provision in the standard which allows for for specific tags to go with private/protected/public statements?
Qt has #define slots in some header; so to the cpmpiler, the translation unit looks like:
1 2 3 4 5
class SomeClass : QSomeOtherClass
{
privateslots:
someSlot();
};
The token slots is used by the meta object compiler to generate extra code (for signal definitions). Qt is riddled with horrible kludges of this kind; probably written long ago, before meta-programming became mainstream C++.