If you have a templated class or a templated function, (or combination of the two), how do you bind that function, (preserving the template type parameter)?
I was gi
MyClass's c-tor doesn't know anything about FunctionTemplateType
that's why it can push_back only explicit specialized (sorry, it's term of mine... I don't know the right term) like this
#include
#include
#include
struct Storage
{
// Have no idea what this signature should really be:
static std::vector> Functions;
};
std::vector> Storage::Functions;
template
class MyClass
{
template
std::string MyFunction(std::string myParameter)
{
return "Hellö: " + myParameter;
}
public:
MyClass()
{
Storage::Functions.push_back(
std::bind( & MyClass::MyFunction, this, "borisbn" )
// ^^^^^^^^^^^
);
}
};
int main() {
MyClass obj;
}
liveworkspace link