I am making a template class with an inner utility class. All specializations of the template want the same inner class:
template<...> class Outer {
class Inner { };
};
That gives me Outer<...>::Inner but I want all Inner to be the same type, as if I’d just written:
class Inner { };
template <...> class Outer { };
or if Outer were simply not a template class:
class Outer {
class Inner { };
};
giving me Outer::Inner. I’d like to have Outer::Inner work for all Outer<> if that’s possible (just for namespace/clarity reasons). Otherwise of course I can just move Inner out.
The nested class can be a non-template, but every instantiation of the template will have its own nested class because they’re (otherwise) unrelated types. You can do