I'm practicing various C++ exercises. In this particular exercise they are asking me to implement an in memory database. I guess they are not asking me to use something like SQLlite. Could anybody give some general pointers as to how I should tackle this please? Would I use C++ maps. I'm struggling to understand what they mean by in memory?
I assume you're allowed (expected) to use the STL (or whatever it's called these days -- the "standard library", probably).
To "store items of distinct types", use some template container(s).
To support "item belongs to one category", store item+category pairs (which is more-or-less how a database would do it), or sets of items for each category (possibly a single map with category as key and set of items as values).
It says "distinct" types so perhaps you can't assume the types are related at all.
"In memory" means it doesn't need to be serialized or saved to disk ... and presumably mustn't use an existing database implementation which isn't part of the C++ standard library.
It's not clear to me what the "identity" of an item is. E.g. does every type have an ID? Or do you pass the address of (i.e. a pointer to) an item as a parameter to the remove method?