Document Number: WG21/N0967R1 X3J16/96-0149R1 Date: 11 July 1996 Project: Programming Language C++ Reply to: Randy Smithey smithey@roguewave.com Relational Operators for Standard Library Classes I. Summary of the Issue In a library reflector message I pointed out that the new library namespace, rel_ops (adoptedin Santa Cruz), prevents us from assuming that the global relational operators will be available for standard objects. The working paper, as it stands now, does assume these operators are available. The following specifies all locations in the library whererelational operators must be specified explicitly in order to remove this assumption. II. Proposed Resolution Change The Working Paper as follows: Section 17.3.1.1 [ Paragraph 9 Add the following to table 5 (Standard Template Operators): operator!= (pair) operator> (pair) operator>=(pair) operator<=(pair) operator!= (deque) operator> (deque) operator>=(deque) operator<=(deque) operator!= (list) operator> (list) operator>=(list) operator<=(list) operator!= (vector) operator> (vector) operator>=(vector) operator<=(vector) operator!= (stack) operator> (stack) operator>=(stack) operator<=(stack) operator!= (queue) operator> (queue) operator>=(queue) operator<=(queue) operator!= (map) operator> (map) operator>=(map) operator<=(map) operator!= (multimap) operator> (multimap) operator>=(multimap) operator<=(multimap) operator!= (set) operator> (set) operator>=(set) operator<=(set) operator!= (multiset) operator> (multiset) operator>=(multiset) operator<=(multiset) operator!= (reverse_bidirectional_iterator) operator!= (reverse_iterator) operator> (reverse_iterator) operator>=( reverse_iterator) operator<=( reverse_iterator) operator!= (istream_iterator) operator!= (istreambuf_iterator) Section 20.2 [lib.utility] and Section 20.2.2 [lib.pairs] Add the following declarations: template bool operator!=(const pair&, const pair&); template bool operator> (const pair&, const pair&); template bool operator>=(const pair&, const pair&); template bool operator<= (const pair&, const pair&); Section 23.2 [lib.sequences] Add the following declarations in the appropriate synopsis': template bool operator!=(const deque& x, const deque& y); template bool operator> (const deque& x, const deque& y); template bool operator>=(const deque& x, const deque& y); template bool operator<=(const deque& x, const deque& y); template bool operator!=(const list& x, const list& y); template bool operator> (const list& x, const list& y); template bool operator>=(const list& x, const list& y); template bool operator<= (const list& x, const list& y); template bool operator!=(const vector& x, const vector& y); template bool operator> (const vector& x, const vector& y); template bool operator>=(const vector& x, const vector& y); template bool operator<=(const vector& x, const vector& y); template bool operator!=(const vector& x, const vector& y); template bool operator> (const vector& x, const vector& y); template bool operator>=(const vector& x, const vector& y); template bool operator<=(const vector& x, const vector& y); template bool operator!=(const queue& x, const queue& y); template bool operator> (const queue& x, const queue& y); template bool operator>=(const queue& x, const queue& y); template bool operator<=(const queue& x, const queue& y); template bool operator!=(const stack& x, const stack& y); template bool operator> (const stack& x, const stack& y); template bool operator>=(const stack& x, const stack& y); template bool operator<=(const stack& x, const stack& y); Section 23.3 [lib.associative] Add the following declarations to the synopsis: template bool operator!=(const map& x, const map& y); template bool operator> (const map& x, const map& y); template bool operator>=(const map& x, const map& y); template bool operator<=(const map& x, const map& y); template bool operator!=(const multimap& x, const multimap& y); template bool operator> (const multimap& x, const multimap& y); template bool operator>=(const multimap& x, const multimap& y); template bool operator<= (const multimap& x, const multimap& y); template bool operator!=(const set& x, const set& y); template bool operator> (const set& x, const set& y); template bool operator>=(const set& x, const set& y); template bool operator<= (const set& x, const set& y); template bool operator!=(const multiset& x, const multiset& y); template bool operator> (const multiset& x, const multiset& y); template bool operator>=(const multiset& x, const multiset& y); template bool operator<=(const multiset& x, const multiset& y); Section 24.2 [lib.iterator.synopsis] Add the following declarations to the synopsis: template bool operator!=(const reverse_bidirectional_iterator & x, const reverse_bidirectional_iterator &y); template bool operator!=(const reverse_iterator & x, const reverse_iterator & y); template bool operator>(const reverse_iterator & x, const reverse_iterator & y); template bool operator>=(const reverse_iterator & x, const reverse_iterator & y); template bool operator<=(const reverse_iterator & x, const reverse_iterator & y); template bool operator!=(const istream_iterator& x, const istream_iterator& y); Section 24.4.1.1 [lib.reverse.bidir.iter] Add the following declaration: template bool operator!=(const reverse_bidirectional_iterator & x, const reverse_bidirectional_iterator &y); Add the following working paper text after Section 24.4.1.2.7 [lib..reverse.bidir.iter.op==]: 24.4.1.2.? operator!= [lib.reverse.bidir.iter.op!=] template bool operator!=(const reverse_bidirectional_iterator & x, const reverse_bidirectional_iterator &y); Returns: !(x == y) Section 24.4.1.3 [lib.reverse.iterator] Add the following working paper text: template bool operator!=(const reverse_iterator & x, const reverse_iterator & y); template bool operator>(const reverse_iterator & x, const reverse_iterator & y); template bool operator>=(const reverse_iterator & x, const reverse_iterator & y); template bool operator<=(const reverse_iterator & x, const reverse_iterator & y); Add the following after 24.4.1.4.12 [lib.reverse.iter.op==]: 24.4.1.4.?? operator!= [lib.reverse.iter.op!=] template bool operator!=(const reverse_iterator & x, const reverse_iterator & y); Returns: !(x == y) Add the following after 24.4.1.4.13 [lib.reverse.iter.op<]: 24.4.1.4.?? operator> [lib.reverse.iter.op>] template bool operator>(const reverse_iterator & x, const reverse_iterator & y); Returns: y < x 24.4.1.4.?? operator>= [lib.reverse.iter.op>=] template bool operator>=(const reverse_iterator & x, const reverse_iterator & y); Returns: !(x < y) 24.4.1.4.?? operator<= [lib.reverse.iter.op<=] template bool operator<=(const reverse_iterator & x, const reverse_iterator & y); Returns: !(y < x) Section 24.5.1 Add the following declaration: template bool operator!=(const istream_iterator& x, const istream_iterator& y);