With C++23 there will be
std::pair<T1, T1>::operator =( const pair &other ) const;
For me an assignment-operator operating on const-objects doesn't make any sense since the object can't be modified. Why will C++23 have this operator on pair ? And even more confusing, there's:
std::pair<T1, T1>::operator =( pair &&other ) const;
[EDIT]: This won't work because what this points to will be const:
template<typename T>
struct S
{
void operator +=( T x ) const;
T m_x;
};
template<typename T>
void S<T>::operator +=( T x ) const
{
m_x += x;
}
int main( int argc, char **argv )
{
S<int> si;
si += 1;
}
So why is there a const-qualified assignment-operator with pair ?