cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
create set with advanced allocator: how
create set with advanced allocator: how to create default Compare() obj?
Dec 7, 2012 at 8:06pm UTC
icegood
(63)
I need smth like that:
TBufferedAllocator<int> MyAlloc(my_pool);
std::set<foo, std::less<foo>, TBufferedAllocator<int>>
v_foo(std::less<foo>(), MyAlloc);
Of couse, std::less<foo>() is not what i should do...
And in gcc 4.7.2 next syntax doesn't work too:
std::set<foo, std::less<foo>, TBufferedAllocator<int>> v_foo(MyAlloc);
despite it in c++11 standart.
Command line:
g++ -std=c++11 test_set.cpp -g
Dec 8, 2012 at 4:57am UTC
Cubbi
(4774)
gcc (or, rather, libstdc++) fell far behind on many things C++11: regular expressions and unicode are the big ones, but allocators too, it seems.
Your example (after I defined all the undefined symbols) compiles fine with clang++ (using libc++) and with Visual Studio 2012.
Topic archived. No new replies allowed.