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錯誤。
我應該怎麼做才能糾正這個錯誤?