There is a code. Is this ok according to the standard? For me it looks like a trick to violate private access.
class Foo
{
class Boo
{
public:
Boo() {std::cout << "BOO" << std::endl;}
void boo() {}
};
public:
Boo b() {return Boo{};};
};
int main()
{
Foo::Boo boo1; // I can't do that because Boo is private
auto boo2 = Foo().b(); // Is also looks weird.
using Boo = decltype(boo2);
Boo boo3; // But I can do that.
return 0;
}