g + 4.7.2 implementa std::set::emplace
, come definito dallo standard C++ 11 e documentato here?std :: set non ha un membro emplace
ho scritto il seguente piccolo banco di prova:
#include <set>
#include <string>
struct Foo
{
std::string mBar;
bool operator<(const Foo& rhs) const
{
return mBar < rhs.mBar;
}
Foo(const std::string bar) : mBar(bar) {};
};
typedef std::set<Foo> Foos;
int main()
{
Foos foos;
foos.emplace(std::string("Hello"));
}
Sotto G ++ 4.7.2, questo non riesce a compilare:
[[email protected] hacks]$ g++ -o main.o -std=c++0x -c main.cpp
main.cpp: In function ‘int main()’:
main.cpp:19:10: error: ‘Foos’ has no member named ‘emplace’
inoltre non riesce a compilare sotto IDEOne, tuttavia si compila sotto Aggiornamento MSVC 2012 1.