SGI Techpubs Library

IRIX 6.5  »  Books  »  Developer  »  
Standard Template Library Programmer's Guide
(document number: 007-3426-004 / published: 1999-05-21)    table of contents  |  additional info  |  download
find in page

SGI

Equality Comparable

Category: utilities Component type: concept

Description

A type is EqualityComparable if objects of that type can be compared for equality using operator==, and if operator== is an equivalence relation.

Refinement of

Associated types

Notation

X A type that is a model of EqualityComparable
x, y, z Object of type X

Definitions

Valid expressions

Name Expression Type requirements Return type
Equality x == y   Convertible to bool
Inequality x != y   Convertible to bool

Expression semantics

Name Expression Precondition Semantics Postcondition
Equality x == y x and y are in the domain of ==    
Inequality x != y x and y are in the domain of == Equivalent to !(x == y)  

Complexity guarantees

Invariants

Identity &x == &y implies x == y
Reflexivity x == x
Symmetry x == y implies y == x
Transitivity x == y and y == z implies x == z

Models

Notes

See also

LessThanComparable.
[Silicon Surf] [STL Home]
Copyright © 1999 Silicon Graphics, Inc. All Rights Reserved. TrademarkInformation

Standard Template Library Programmer's Guide
(document number: 007-3426-004 / published: 1999-05-21)    table of contents  |  additional info  |  download


home/search | what's new | help

Contact Us | Site Map | Trademarks | Privacy | Using this site means you accept its Terms of Use

Copyright © 1993-2007 SGI, Inc. All rights reserved.