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 libstdc++/48313] New: std::bind with template function


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

           Summary: std::bind with template function
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: joerg.richter@pdv-fs.de


$ cat > t.cc << EOF
#include <functional>

template<class T> void func( T )
{}

int main( int, char** )
{
  std::bind( func<int>, 0 );
}
EOF

$ g++ t.cc -std=gnu++0x
t.cc: In function 'int main(int, char**)':
t.cc:8:27: error: cannot bind 'void(int)' lvalue to 'void (&&)(int)'
...

This is with GCC 4.6.0.  This works with GCC 4.5.2.


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