Suitable casts are required so that assignment of instances of nested classes work as the nested class is duplicated in the global namespace, eg: struct Outer { struct Nested { int bar; } bar_instance; }; Outer.bar_instance can now be assigned to.