# PartialOrd, comparison operators,SIMD

**URL:** <https://internals.rust-lang.org/t/partialord-comparison-operators-simd/253>\
**Category:** ideas (deprecated)\
**Created:** [July 23, 2014, 10:29pm UTC](https://internals.rust-lang.org/t/partialord-comparison-operators-simd/253 "2014-07-23T22:29:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dobkeratops](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/dobkeratops/32/4577_2.png) [@dobkeratops](https://internals.rust-lang.org/u/dobkeratops)\
**Post date:** [July 23, 2014, 10:29pm UTC](https://internals.rust-lang.org/t/partialord-comparison-operators-simd/253/1 "2014-07-23T22:29:25Z")

</div>

Currently in C++ you can overload the comparison operators to wrap SIMD component wise compare producing select masks, e.g. by introducing a concept of a ‘vectorized bool’.

Could the comparison operators be separated from the PartialOrd trait to allow them to be overloaded like this. put the operators in a ‘Compare’ trait?

Is it possible to reconcile both uses of the comparison operators - perhaps e.g. could PartialOrd give ‘fn partial\_cmp’, and the lib provides a generic impl of Compare for any T:PartialOrd. , whilst SIMD types of [T:PartialOrd,…N] would implement Compare\<[u32,…N]\> …but not PartialOrd

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:22am UTC](https://internals.rust-lang.org/t/partialord-comparison-operators-simd/253/2 "2019-03-25T08:22:40Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
