Consider this:
template <typename T>
struct A {
using MyType1 = ...;
using MyType2 = ...;
using MyType3 = ...;
using MyType4 = ...;
using MyType5 = ...;
...
};
template <typename T>
struct B: A<T> {
using MyType1 = typename A<T>::MyType1;
using MyType2 = typename A<T>::MyType2;
using MyType3 = typename A<T>::MyType3;
using MyType4 = typename A<T>::MyType4;
using MyType5 = typename A<T>::MyType5;
...
};
template <typename T>
struct C: A<T> {
using MyType1 = typename A<T>::MyType1;
using MyType2 = typename A<T>::MyType2;
using MyType3 = typename A<T>::MyType3;
using MyType4 = typename A<T>::MyType4;
using MyType5 = typename A<T>::MyType5;
...
};
... // Many more classes in the hierarchy
// with all the type declarations duplicated in each of them.
Is there any way this can be made shorter?
A related question was asked, but did not make the point of how bad the duplication was and did not receive any replies.