Movatterモバイル変換


[0]ホーム

URL:


Issue 179 - WG21 CWG Issues
Title
Function pointers and subtraction
Status
tc1
Section
7.6.6 [expr.add]
Submitter
Mike Miller

Created on1999-11-15.00:00:00 last changed277 months ago

Messages

msg442 (view)
Date: 2000-10-15.00:00:00

Proposed resolution (10/00):

Remove the wordsor functionfrom paragraph 8.

msg250 (view)
Date: 2003-04-25.00:00:00

7.6.6 [expr.add] paragraph 8explicitlyallows subtraction of two pointers to functions:

If two pointers point to the same objector function... and thetwo pointers are subtracted...
However, 7.6.6 [expr.add] paragraph 2requires that two pointers that are subtracted be pointers to anobject type; function pointers are not allowed.

Being able to subtract two pointers to functions doesn't seemterribly useful, especially considering that subtracting two pointersto different functions appears to produce undefined behavior ratherthan simply a non-zero result, according to paragraph 6:

Unless both pointers point to elements of the same array object, orone past the last element of the array object, the behavior isundefined.
History
DateUserActionArgs
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetmessages: +msg442
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetstatus: open -> ready
1999-11-15 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp