This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78882] New: std::bind not working with templated function
- From: "lcid-fire at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Dec 2016 11:08:52 +0000
- Subject: [Bug c++/78882] New: std::bind not working with templated function
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78882
Bug ID: 78882
Summary: std::bind not working with templated function
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: lcid-fire at gmx dot net
Target Milestone: ---
The following does not compile on GCC up to 7 while working fine in clang and
icc:
#include <functional>
#include <string>
struct Bar {
template <typename T>
T* bar(const char*) {
return nullptr;
}
};
struct In {
};
template <typename T>
auto anonymousWrap(Bar& bar, std::string const& name, const char* other) {
auto res = bar.bar<T>(name.c_str());
return res;
};
int main() {
using namespace std::placeholders;
std::bind(anonymousWrap<In>, _1, _2, "other");
return 0;
}