Let's say I have a custom struct and a mapping:
struct MyStruct {
uint var1
string var2
bool var3
}
mapping(address => MyStruct) myMapping;
If I did this:
//.......
MyStruct elem1 = myMapping[addr1];
I wouldn't be able to know whether elem1 really exists in myMapping, because it would return an element anyway. If it wasn't present, it'd return the one with all the fields initialized with the default values, right?
What's the solution for that?