A portable way to do what you need is approximately:
template<class...Ts>
struct operator_index_inherit {};
template<class T0, class T1, class...Ts>
struct operator_index_inherit<T0, T1, Ts...>:
T0, operator_index_inherit<T1, Ts...>
{
using T0::operator[];
using operator_index_inherit<T1, Ts...>::operator[];
};
template<class T0>
struct operator_index_inherit<T0>:
T0
{
using T0::operator[];
};
then
template<class... Fields>
struct ctmap : operator_index_inherit<Field<Fields>...> {
using base = operator_index_inherit<Field<Fields>...>;
using base::operator[];
};
here we linearly inherit from each of the types, and using operator[]- from our parents.
If we could using Field<Fields>::operator[]...;, we would not have to do it.
Some attention should be paid to designers (which I did not accept), but you may not need to do this.
.
, , . , . , , . ( ), , .