The standard tries to get A built before B So, as you ask, this is not possible.
If A has a constructor for each case, this can be done.
class A { public: structB { int dummy}; A( const structB &){ } ... };
Then similar behavior could be done. You currently do not have B, only constructor options.
source share