I want to overload my wrapper class's subscript operator so I don't need to manually cast it to to it's held type.
template <typename T>
class Value {
private:
T value;
public:
Value<T>() {};
Value<T>(T value) {this->value = value;};
T getValue() { return value; }
operator const T() { return getValue(); }
template <typename K>
decltype((std::declval<T>()[std::declval<K>()])) operator [](K index) {
return value[index];
}
};```
This works for std::vector but not vectors from the extension since subscripting those doesn't return a reference.