Skip to content

Erase by integer index #1018

Description

@zkelo

I have this object.

json obj = { {"Foo", 1}, {"Bar", 2} };

In some cases I have only integer index of Foo (i.e. 0) or Bar (i.e. 1), not a key like "Foo" or "Bar". And I'm need to erase "Bar" using only integer index. If I'm trying to erase "Bar" with using integer index, I'm getting an exception.

So, how I can (if it's possible) erase "Bar" using integer index? Or I need to use cycle like this for (auto it : obj) to find associative key by integer in first?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions