This shows you the differences between two versions of the page.
|
gnucap:manual:tech:plugins:devices:allocation_and_setup [2026/02/09 09:15] felixs add commons |
gnucap:manual:tech:plugins:devices:allocation_and_setup [2026/02/09 09:55] (current) felixs common comparison operators |
||
|---|---|---|---|
| Line 83: | Line 83: | ||
| COMMON_COMPONENTS may share data. The attach/detach mechanism is identical to the one in COMPONENT. | COMMON_COMPONENTS may share data. The attach/detach mechanism is identical to the one in COMPONENT. | ||
| + | |||
| + | == virtual bool COMMON_COMPONENT::operator==(COMMON_COMPONENT const& X) == | ||
| + | |||
| + | Return ''true'' if ''*this'' is indistinguishable from the argument ''X''. When overloading, do not forget to query the base class. | ||
| + | |||
| + | == virtual bool COMMON_COMPONENT::has_less()const == | ||
| + | |||
| + | Indicate whether this class provides ''operator<'' to find the unique memory location for each object (or an equivalent copy). Leave alone unless ''operator<'' is actually implemented. | ||
| + | |||
| + | == virtual int COMMON_COMPONENT::compare(COMMON_COMPONENT const& X)const == | ||
| + | |||
| + | Compare ''*this'' with ''X''. A negative value indicates ''<'', a positive means ''>''. This is semantically equivalent to three-way-comparison ''operator<=>'' introduced in C++20. We only support total (aka. strong) ordering. | ||
| + | |||
| + | == virtual bool COMMON_COMPONENT::operator<(COMMON_COMPONENT const&)const == | ||
| + | |||
| + | Return ''true'' if callee is "smaller" than the argument. Here, "smaller" refers to the storage location e.g. in an std::set. When overloading, do not forget to query "compare" of the respective base class. | ||