Created on 2023-08-08.00:00:00 last changed 16 months ago
Consider:
struct S { auto & operator=(this S &, S&&); auto & operator=(this S &, const S&); };
The rule in 11.4.4 [special] paragraph 5 does not treat explicit-object member functions correctly:
Two special member functions are of the same kind if:
- they are both default constructors,
- they are both copy or move constructors with the same first parameter type, or
- they are both copy or move assignment operators with the same first parameter type and the same cv-qualifiers and ref-qualifier, if any.
Possible resolution:
Change in 11.4.4 [special] paragraph 5 as follows:
Two special member functions are of the same kind if:
- they are both default constructors,
- they are both copy or move constructors with the same first parameter type, or
- they are both copy or move assignment operators with the same first non-object parameter type
and, the samecv-qualifiersobject parameter type, and either both are implicit object member functions with no ref-qualifier,if anyor neither of them is.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-08-08 00:00:00 | admin | create |