1
我的环境:RadStudio XE4 UPDATE1上Windows7pro(32位)E2316使用的std ::功能
我试图研究以下占位符页面 http://en.cppreference.com/w/cpp/utility/functional/placeholders
以下是代码,我试图编译。
...
#include <functional>
#include <string>
#include <iostream>
...
static void goodbye(const std::string &s)
{
std::cout << "Goodbye " << s << std::endl;
}
class Object {
public:
void hello(const std::string &s)
{
std::cout << "Hello " << s << std::endl;
}
};
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// [bcc32 error] ...:E2316 'function' is not a member of 'std'
typedef std::function<void(const std::string &)> ExampleFunction;
}
在上面的代码中,我得到了typedef语句中的E2316错误。
我应该怎么做才能纠正这个错误?