4 ms·
It would have to have been designed to use external functions instead (eg spelled std::reset), which might even make the API more consistent since many accessor
by manwe150 2y ago
It would have to have been designed to use external functions instead (eg spelled std::reset), which might even make the API more consistent since many accessor functions already require doing just that (eg std::begin)
- spacechild1 2y agoFree functions like `std::begin` are meant for generic code. Apart from that, how would you even access the private members if the dot-operator was overloaded? (C++ does not support overloading the dot-operator for good reasons.)
- manwe150 2y agoAlso with some function, perhaps even the existing one std::get<1>, like for some other existing types where the dot-operator is already broken. The special purpose field-access ability and the special-purpose dot syntax don’t have to the same exact operator, though I appreciate there were logical reasons for C++ to historically choose to combine them