Map helpers for strict use

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Dev Tools 2019-09-09, Dev Tools 2019-09-09, Dev Tools 2019-09-23
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I recently ended up creating translation unit-static functions for more strict access patterns with stdx::unordered_map/_set. I suspect that a set of helpers with invariants might be more useful to the codebase at large:

      • getOrInvariant() which invariants that the key already exists (roughly equivalent to at()).
      • emplaceOrInvariant() which invariants that the key did not already exist.
      • eraseOrInvariant() which invariants that the key existed and will no longer.

      This set of operations allows a developer to confidently use a map or set to contain a unique set of initialized objects.

            Assignee:
            Billy Donahue
            Reporter:
            Benjamin Caimano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: