// To store a multi-selection, in your application you could:
// - A) Use this helper as a convenience. We use our simple key->value ImGuiStorage as a std::set<ImGuiID> replacement.
// - B) Use your own external storage: e.g. std::set<MyObjectId>, std::vector<MyObjectId>, interval trees, etc.
// - C) Use intrusively stored selection (e.g. 'bool IsSelected' inside objects). Not recommended because you can't have multiple views
// over same objects. Also some features requires to provide selection _size_, which with this strategy requires additional work.
// - C) Use intrusively stored selection (e.g. 'bool IsSelected' inside objects). Doing that, you can't have multiple views over
// your objects. Also, some features requires to provide selection _size_, which with this strategy requires additional work.
// In ImGuiSelectionBasicStorage we:
// - always use indices in the multi-selection API (passed to SetNextItemSelectionUserData(), retrieved in ImGuiMultiSelectIO)
// - use the AdapterIndexToStorageId() indirection layer to abstract how persistent selection data is derived from an index.
// - so this helper can be used regardless of your object storage/types, and without using templates or virtual functions.
// - use the AdapterIndexToStorageId() indirection layer to abstract how persistent selection data is derived from an index,
// so this helper can be used regardless of your object storage/types (it is analogous to using a virtual function):
// - in some cases we read an ID from some custom item data structure (similar to what you would do in your codebase)
// - in some cases we use Index as custom identifier (default implementation returns Index cast as Identifier): only OK for a never changing item list.
// Many combinations are possible depending on how you prefer to store your items and how you prefer to store your selection.
// When your application settles on a choice, you may want to get rid of this indirection layer and do your own thing.
// Large applications are likely to eventually want to get rid of this indirection layer and do their own thing.
// See https://github.com/ocornut/imgui/wiki/Multi-Select for minimum pseudo-code example using this helper.
// (In theory, for maximum abstraction, this class could contains AdapterIndexToUserData() and AdapterUserDataToIndex() functions as well,
// but because we always use indices in SetNextItemSelectionUserData() in the demo, we omit that indirection for clarity.)