Following code compile (MSVC C++ latest) using std::unordered_map but not with the new boost:unordered_flat_map:
#include "boost/unordered/unordered_flat_map.hpp"
#include <unordered_map>
class Foo
{
public:
Foo() = default;
explicit Foo(int x) : m_x_(x) {};
private:
int m_x_;
std::mutex mtx;
};
int main(int argc, char** argv)
{
boost::unordered_flat_map<int,Foo> map_test; //compile with std::unordered_map
map_test.try_emplace(1,1);
return 0;
}
I dont expect it to work with flat_map as with std::map , guessing as the map need reordering, elements need to be able to move/copy. But I dont get why its working with unordered_map and not boost:unordered_flat_map.