g++ - How to compile a c++ program with std::bind? -
i want compile simple test.cpp program wrox's professional c++:
#include<iostream> #include<functional> using namespace std;  void func(int num, const string& str) {             cout << num << ' ' << str << endl; }  int main() {     string str = "abc";     auto f = bind(func, placeholders::_1, str);     f(16); } i have g++ (debian 4.4.5-8) 4.4.5 compilator , use that:
g++ -std = c++0x test.cpp -o test i error:
error: no match call ‘(std::_bind<void (*(std::_placeholder<1>, int)) (int, int)>) (int)’ why program not compile?
i cannot compile example program c++ reference well.
std::bind c++11, not supported g++ 4.4 need upgrade @ least debian wheezy's g++ 4.7 system upgrade or using /etc/apt/preferences package bindings
Comments
Post a Comment