File: strongorder.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (22 lines) | stat: -rw-r--r-- 1,098 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
The class tt(std::strong_ordering)hi(strong_ordering) is used when
implementing the spaceship operator for classes that support all comparison
operators (where one operand may be zero), as well as substitutability.

The class tt(strong_ordering) provides free functions for all comparison
operations (tt(==, !=, <, <=, >,) and tt(>=)) expecting tt(partial_ordering)
arguments (one argument may be 0). It also defines three static objects which
can be returned by the spaceship operator:
    itemization(
    itt(strong_ordering::less), returned when the lhs operand of the
        spaceship operator should be ordered before the rhs operand;
    itt(strong_ordering::equal), indicating equality: there is no
        ordering preference between the two operands of the spaceship operator;
    itt(strong_ordering::greater), returned when the lhs operand of the
        spaceship operator should be ordered after the rhs operand;
    )

An example where the class tt(strong_ordering) was used has already been
provided in section ref(SPACESHIP), where the spaceship operator itself was
introduced.