Here's my code/namespace:
namespace myNamespace {
enum MyType {
ASD1,
ASD2,
ASD3
};
struct MyClass {
MyType mMyType;
MyClass(MyType myType = MyType::ASD1) : mMyType(myType) {
}
};
}
Now if I try, within another struct, this code:
struct X
{
myNamespace::MyClass *pMyClass1 = new myNamespace::MyClass(myNamespace::MyType::ASD2);
};
it works perfectly, but if I try this:
struct X
{
myNamespace::MyClass mMyClass1(myNamespace::MyType::ASD2);
};
it says 'myNamespace::MyType::ASD2' is not a type
.
Since its all declared before, why this?