Update to work with GCC 5
GCC 5's implementation of std::map::emplace cannot handle the implicit conversion from a pointer to a unique_ptr. For example, the following will not compile on GCC 5.5:
#include <map>
#include <memory>
#include <utility>
struct Foo
{
virtual ~Foo() {}
};
int main(int, char**)
{
std::map<int, std::unique_ptr<Foo>> map;
map.emplace(std::make_pair(3, new Foo));
return 0;
}
This MR updates the emplace method to move the unique_ptr into the map.
Edited by T.J. Corona