mirror of
https://github.com/libretro/cpp-cheat.git
synced 2025-04-11 16:00:52 +00:00
32 lines
782 B
C++
32 lines
782 B
C++
|
|
#include "common.hpp"
|
|
|
|
int main() {
|
|
// # typedef
|
|
{
|
|
// It is possible to call constructors with typedefs
|
|
{
|
|
class C {
|
|
public:
|
|
int i;
|
|
C(int i) : i(i) {}
|
|
};
|
|
typedef C CTypedef;
|
|
CTypedef b = CTypedef(1);
|
|
}
|
|
|
|
// Typdefs inside classes follow public / private scoping.
|
|
{
|
|
class ClassWithTypedef {
|
|
public:
|
|
typedef int typedefPublic;
|
|
private:
|
|
typedef int typedefPrivate;
|
|
};
|
|
ClassWithTypedef::typedefPublic i;
|
|
// ERROR: not accessible from this context
|
|
//ClassWithTypedef::typedefPrivate j;
|
|
}
|
|
}
|
|
}
|