This won't work:
struct MyData {
MyData();
std::string foo;
long bar;
}
class MyTest {
public:
std::unordered_set<MyData&> data;
}
I want to be as efficient as possible and don't want the objects to be copied when accessed or inserted.
Why does std::unordered_set<MyData*> data;
work, if the pointer is just the address and so is the reference?