mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Elaborated that we can't generally add comparison operators to C structs
This commit is contained in:
parent
eba3eddf67
commit
2dc6d0d5ea
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user