Whenever a generic class is specialized with a different set of template types, this results in a new, distinct type.
The types are assignment compatible if the same template types are used.
If the same types are used, and compiler can reuse a previously generated generic, it will reuse this previously generated generic, but this is not guaranteed to be possible: you may still have 2 separate generic types, but they will be assignment compatible.
Take the following generic definition:
And the following specializations:
the following specializations is identical, but appears in a different unit:
The following will then compile:
The types ub.TB and uc.TB are assignment compatible. It does not matter that the types are defined in different units. They could be defined in the same unit as well:
Each specialization of a generic class with the same types as parameters is a new, distinct type, but these types are assignment compatible if the template types used to specialize them are equal.
If the specialization is with a different template type, the types are still distinct, but no longer assignment compatible. i. e. the following will not compile:
When compiling, an error will result: