# \[idea\] make PartialOrd method returns custom methods

**URL:** <https://internals.rust-lang.org/t/idea-make-partialord-method-returns-custom-methods/22727>\
**Category:** Uncategorized\
**Created:** [April 10, 2025, 6:14am UTC](https://internals.rust-lang.org/t/idea-make-partialord-method-returns-custom-methods/22727 "2025-04-10T06:14:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mathstuf](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mathstuf](https://internals.rust-lang.org/u/mathstuf)\
**Post date:** [April 10, 2025, 7:18am UTC](https://internals.rust-lang.org/t/idea-make-partialord-method-returns-custom-methods/22727/2 "2025-04-10T07:18:38Z")

</div>

I think, in general, you want expression templates for this.

> **[Expression templates](https://en.wikipedia.org/wiki/Expression_templates)**
>
> Expression templates are a C++ template metaprogramming technique that builds structures representing a computation at compile time, where expressions are evaluated only as needed to produce efficient code for the entire computation. Expression templates thus allow programmers to bypass the normal order of evaluation of the C++ language and achieve optimizations such as loop fusion.
> Expression templates were invented independently by Todd Veldhuizen and David Vandevoorde; it was Veldhuizen who g...

Other related threads/comments:

- [Implicit buffers, overloading the assignment operator - #2 by scottmcm](https://internals.rust-lang.org/t/implicit-buffers-overloading-the-assignment-operator/8751/2)
- [Consider splitting [Partial]Eq/Ord into separate traits/operators - #4 by mathstuf](https://internals.rust-lang.org/t/consider-splitting-partial-eq-ord-into-separate-traits-operators/19695/4)

---

_[View the full topic](https://internals.rust-lang.org/t/idea-make-partialord-method-returns-custom-methods/22727)._
