I recently learnt that std::reference_wrapper<T>
has an overload for the the function call operator in case T
is function-like. I wonder whether there is a reason given by the standard committee to not include an array subscript operator in cases where we capture something like std::vector
. It seems weird to me that only one of the two typical operators which can be overloaded only as a class member are present in this standard class.
What is the rationale behind this?