I have a class named Registry which correlates an ID with some data.
I would like to make it so the underlying structure which stores these pairs can be any std::mapish type, of which the user can define (e.g.: std::map, std::unordered_map).
My initial thought was to do something like this:
template<typename Value, typename Container, typename ID = size_t>
class Registry{
using Storage = Container<ID, value>;
static_assert(std::is_same<Storage, std::map> || std::is_same<Storage, std::map>, "Underlying storage type must be a std::map-ish.");
public:
Storage<ID, Value> store;
...
However, trying to use the class results in an error:
Registry<bool, std::map> testRegistry;
err) argument list for class template std::map is missing
I understand the compiler's complaint, but is there any way to work around it so that this syntax (or something similar) might work?
Thanks for the advice.