2 ms·
Hmm, what should I do? (since it returns a reference). I could make it a pointer instead, but then you wouldn't be able to chain it. Maybe some kind of const j
by udp 15y ago
Hmm, what should I do? (since it returns a reference). I could make it a pointer instead, but then you wouldn't be able to chain it.
Maybe some kind of const json_null value to return when the key isn't found.
edit: Done that.
- mahmud 15y agolongjmp to an earlier stage where you can "retract" the error or somehow wrap it in a chainable form (e.g. add a union to your result to signal whether it's a value or error, or whatever) That's what exceptions are supposed to do. C doesn't have exceptions, so you use setjmp/longjmp.