Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-12-20


879. Missing built-in comparison operators for pointer types

Section:12.5  [over.built]    Status:CD2    Submitter:Daniel Krügler    Date:25 April, 2009

[Voted into WP at October, 2009 meeting.]

12.5 [over.built] paragraph 15 restricts the built-in comparisonoperators to

everyT, whereT is an enumeration type or pointer toeffective object type

This omits both pointers to function types and pointers to void.

Proposed resolution (July, 2009):

  1. Add a new paragraph following 7.6.9 [expr.rel] paragraph 2:

  2. Pointers tovoid (after pointer conversions) can becompared, with a result defined as follows: If both pointers representthe same address or are both the null pointer value, the result istrue if the operator is<= or>= andfalse otherwise; otherwise the result is unspecified.
  3. Change 7.6.10 [expr.eq] paragraph 1 as follows:

  4. ...Pointersto objects or functions of the same type (afterpointer conversions) can be compared for equality...
  5. Change 12.5 [over.built] paragraph 15 as follows:

  6. For everyT, whereT is an enumeration typeor, a pointerto effective object type,orstd::nullptr_t, there exist candidate operatorfunctions of the form...



[8]ページ先頭

©2009-2026 Movatter.jp