3 ms·
It's better to do object.at("member").at("sub") so that it throws an exception instead of seg faulting if one of the keys doesn't exist
by umvi 7y ago
It's better to do object.at("member").at("sub") so that it throws an exception instead of seg faulting if one of the keys doesn't exist
- snagglegaggle 7y agoSure, I was kind of envisioning overloading []. It did make me think though: perhaps it is best to have an embedded interpreter for accessing member items? It is what gcrypt does, actually -- embedded lisp syntax. I always wondered why and I think now I know.