When declaring assignment operations as default
, is there anything wrong to make them reference qualified to prevent assignment to temporaries? (Most often than not, it prevents stupid errors).
Common resources, do not say anything about reference qualifiers for "default" operations, and almost every example I've seen so far, doesn't declare them with proper ref-qualifier.
Does language standard say anything about reference qualifiers declaring assignment operations as default.
- It is allowed?
- Is there anything wrong about doing that? After all, with very few exceptions, assigning to rvalues doesn't make sense.
- I understand that they were not made reference qualified by default for backwards compatibility, however is there a reason not to that? (In case that the answer to first question is "yes" and the answer to the second one is "no").