Может кто -нибудь объяснить, почему я получаю: < /p>
Ошибка C2064: Термин не оценивает функцию, принимающую 1 аргументы < /p>
< /blockquote>
для строки: < /p>
DoSomething->*pt2Func("test");
< /code>
с этим классом < /p>
#ifndef DoSomething_H
#define DoSomething_H
#include
class DoSomething
{
public:
DoSomething(const std::string &path);
virtual ~DoSomething();
void DoSomething::bar(const std::string &bar) { bar_ = bar; }
private:
std::string bar_;
};
#endif DoSomething_H
< /code>
и < /p>
#include "DoSomething.hpp"
namespace
{
void foo(void (DoSomething::*pt2Func)(const std::string&), doSomething *DoSomething)
{
doSomething->*pt2Func("test");
}
}
DoSomething::DoSomething(const std::string &path)
{
foo(&DoSomething::bar, this);
}
Подробнее здесь: https://stackoverflow.com/questions/153 ... -arguments