#include "robin_hood.h"
#include <string>
class A {
private:
std::string x;
public:
A() = delete;
A& operator=(const A& other) = delete;
A(A&& other) : x(std::move(other.x)){}
explicit A(std::string x) : x(std::move(x)) {}
};
int main(int argc, char** argv) {
robin_hood::unordered_flat_map<std::string, A> m;
m.emplace("ok", "hi");
return 0;
}
From the document it seems the choice over flat map and node map is from memory concerns, otherwise, they can be used interchangeably. But the above code just can't compile in flat map mode. only unordered_map works.
From the document it seems the choice over flat map and node map is from memory concerns, otherwise, they can be used interchangeably. But the above code just can't compile in flat map mode. only unordered_map works.