问题描述
所有基本比较(<
,<=
,==
,!=
,>=
,>
)都具有关联的功能对象( std::less
,std::less_equal
,std::equal_to
,std::not_equal_to
,std::greater_equal
,std::greater
)。
宇宙飞船运营商<=>
是否具有类似的功能对象?
如果没有,为什么不将其添加到标准库中?
解决方法
std::compare_three_way
是用于三向比较的功能对象(又称太空飞船算子)。