---
name: "std::rel_ops"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::rel_ops/3cxx"
---

# std::rel\_ops(3cxx)

The generated relational operators are sequestered here.

## NAME

std::rel\_ops - The generated relational operators are sequestered here.

## SYNOPSIS

### Functions

template\<**class** \_Tp \> bool **operator!=** (const \_Tp &\_\_x, const \_Tp &\_\_y)\
 Defines `!=` for arbitrary types, in terms of `==`.  template\<**class** \_Tp \> bool **operator\<=** (const \_Tp &\_\_x, const \_Tp &\_\_y)\
 Defines `<=` for arbitrary types, in terms of `<`.  template\<**class** \_Tp \> bool **operator\>** (const \_Tp &\_\_x, const \_Tp &\_\_y)\
 Defines `>` for arbitrary types, in terms of `<`.  template\<**class** \_Tp \> bool **operator\>=** (const \_Tp &\_\_x, const \_Tp &\_\_y)\
 Defines `>=` for arbitrary types, in terms of `<`.

## Detailed Description

The generated relational operators are sequestered here.

Libstdc++ headers must not use the contents of `rel_ops`. User code should also avoid them, because unconstrained function templates are too greedy and can easily cause ambiguities.

C++20 default comparisons are a better solution.

## Function Documentation

### template\<class \_Tp \> bool std::rel\_ops::operator!= (const \_Tp & \_\_x, const \_Tp & \_\_y)` [inline]`

Defines `!=` for arbitrary types, in terms of `==`.

**Parameters**

*\_\_x* A thing. \
 *\_\_y* Another thing.

**Returns**

\_\_x != \_\_y

This function uses `==` to determine its result.

### template\<class \_Tp \> bool std::rel\_ops::operator\<= (const \_Tp & \_\_x, const \_Tp & \_\_y)` [inline]`

Defines `<=` for arbitrary types, in terms of `<`.

**Parameters**

*\_\_x* A thing. \
 *\_\_y* Another thing.

**Returns**

\_\_x \<= \_\_y

This function uses `<` to determine its result.

### template\<class \_Tp \> bool std::rel\_ops::operator\> (const \_Tp & \_\_x, const \_Tp & \_\_y)` [inline]`

Defines `>` for arbitrary types, in terms of `<`.

**Parameters**

*\_\_x* A thing. \
 *\_\_y* Another thing.

**Returns**

\_\_x \> \_\_y

This function uses `<` to determine its result.

### template\<class \_Tp \> bool std::rel\_ops::operator\>= (const \_Tp & \_\_x, const \_Tp & \_\_y)` [inline]`

Defines `>=` for arbitrary types, in terms of `<`.

**Parameters**

*\_\_x* A thing. \
 *\_\_y* Another thing.

**Returns**

\_\_x \>= \_\_y

This function uses `<` to determine its result.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
