You are using the wrong one placeholders, you need to _1:
auto fun = std::bind(&keyFormatter, sKeyFormat, std::placeholders::_1);
The placeholder number here does not match the args position, but rather chooses which arguments to send to the original function, in which position:
void f (int, int);
auto f1 = std::bind(&f, 1, std::placeholders::_1);
f1(2);
auto f2 = std::bind(&f, std::placeholders::_2, std::placeholders::_1);
f2(3, 4);
auto f3 = std::bind(&f, std::placeholders::_2, 4);
f3(2, 5);
See std::bind, especially the examples at the end.
source
share