Is there any recommendation against creating a derived in a different namespace than of its parent? Such as:
namespace NA {
class A {};
}
namespace NB {
class B : NA::A {}
}
Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries.
If you think class A and class B should have under different namespaces (groups), kept them under different namespaces (groups). And when you need to access/ inherit one class from another, you just access/ inherit it following namespace standard.
I don't see any problems here, rather it is a good practice.
Thanks !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With