I've got a problem with member type definitions. Here is the situation :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class A;
// What am I supposed to write here
class Bar {
fn(const Foo::Alias&); // using Alias but it's not defined yet
};
class Foo {
Bar mBar;
// the alias
using Alias = A;
};
If Foo were a namespace, that wouldn't have been a problem. But it's a class, and I cannot partially define it. Does anybody have an idea ?
Why is the alias defined in Foo if it is used by Bar and Foo has a Bar? It should be defined in Bar, and Foo can just redefine its own based on Bar's if it needs to.
Why is the alias defined in Foo if it is used by Bar and Foo has a Bar? It should be defined in Bar, and Foo can just redefine its own based on Bar's if it needs to.
In fact, my code is :
1 2 3 4
class Game {
public:
using TimeUnit = chrono::duration<double>;
};
I wouldn't make sense if the alias were in another class. ;)