#include <vector>
#include <functional>
int main(int argc, char** argc)
{
std::vector<int> x;
std::function<void (void)> f(std::allocator_arg,x.get_allocator());
return 1;
}
Using : g++ test.cpp -o test -std=c++11
It failed on Ubuntu 15
, my g++ version is 5.2.1
. it's all ok on XCode
and VS2015
. and I check /usr/include/c++/5/functional
, it has no constructor for allocators. I check www.cplusplus.com
, and It defines the constructor with allocator.
Someone can tell me how to fix this problem or I have to change the g++ stl,
How to change g++ stl with other stl ? I have downloaded sgi stl source codes.
Please help ! Thanks a lot .