You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to examine a const JSONVar object using operator[] (e.g. auto foo = myVar["bar"]), the compiler will (obviously) not be able locate the nonexistent const operator[], but it won't quit there. Instead, it will (silently) beat your JSONVar sword into some unrelated plowshare and apply type type's const operator[] , with predictably nonsensical results.
For example, this code:
If you try to examine a
const JSONVar
object usingoperator[]
(e.g.auto foo = myVar["bar"]
), the compiler will (obviously) not be able locate the nonexistent constoperator[]
, but it won't quit there. Instead, it will (silently) beat your JSONVar sword into some unrelated plowshare and apply type type's constoperator[]
, with predictably nonsensical results.For example, this code:
produces this output:
foo: f
If I add this method to JSONVar:
then the output changes to a more reasonable
foo: "bar"
The text was updated successfully, but these errors were encountered: