Elaborated that we can't generally add comparison operators to C structs

This commit is contained in:
Herb Sutter 2021-07-08 11:21:41 -07:00
parent eba3eddf67
commit 2dc6d0d5ea

View File

@ -4565,6 +4565,10 @@ In particular, if a concrete type is copyable, prefer to also give it an equalit
##### Note
For structs intended to be shared with C code, defining `operator==` may not be feasible.
##### Note
Handles for resources that cannot be cloned, e.g., a `scoped_lock` for a `mutex`, are concrete types but typically cannot be copied (instead, they can usually be moved),
so they can't be regular; instead, they tend to be move-only.