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


775. Capturing references to functions

Section:7.5.6.3  [expr.prim.lambda.capture]    Status:CD2    Submitter:Steve Adamczyk    Date:12 February, 2009

[Voted into the WP at the July, 2009 meeting as part of N2927.]

According to 7.5.6 [expr.prim.lambda] paragraph 8, the “objecttype” of a captured function is the type to which the referencerefers. That's clearly wrong when the captured reference is areference to a function, because the resulting data member of theclosure class will have a function type:

    void f() { }    void g() {      void (&fr)() = f;      [fr]{};   // Oops...    }

Proposed resolution (July, 2009)

See document PL22.16/09-0117 = WG21 N2927.




[8]ページ先頭

©2009-2026 Movatter.jp