This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/43397] New: std::function can't forward rvalue reference for pointer to member function


std::function can't forward rvalue reference for pointer to member function

struct Foo
{
    void operator() ( int && ) {  }
    void func( int && ) {  }
} ;

int main()
{
    Foo foo ;

    // OK
    std::function< void ( int && ) > f1( foo ) ;
    f1(0) ;

    // Error
    std::function< void ( Foo &, int && ) > f2( &Foo::func ) ;
    f2(foo, 0) ;
}


-- 
           Summary: std::function can't forward rvalue reference for pointer
                    to member function
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: boostcpp at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43397


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]