I am trying to bind to bool std::operator==(const std::string&, const std::string&)
, but I'm getting an error that I hope somebody can help me with.
std::string v1 = "foo";
std::string v2 = "foo";
bool r =
std::bind(
static_cast<bool(*)(const std::string&, const std::string&)>(&std::operator== ),
std::placeholders::_1,
std::cref(v1))(v2);
error: invalid static_cast from type '<unresolved overloaded function type>' to type 'bool (*)(const string&, const string&) {aka bool (*)(const std::basic_string<char>&, const std::basic_string<char>&)}'
&std::operator== ),
^
example: ideone.com