Closed timotejroiko closed 3 years ago
Hello,
I though that something like:
template<template<auto...> class Container>
class Map {
private:
Container<uint64_t, char *> data;
}
would work but it doesn't seem possible.
The only workaround I can think of is:
template<template<class...> class Container>
class Map {
private:
Container<uint64_t, char *> data;
}
template <class Key, class T, class Hash = std::hash<Key>,
class KeyEqual = std::equal_to<Key>,
class Allocator = std::allocator<std::pair<Key, T>>>
using sparse_map = tsl::sparse_map<Key, T, Hash, KeyEqual, Allocator>;
Map<sparse_map>();
I am not sure if there is a better way to circumvent the problem.
Hello, thanks for the reply!
That's exactly what tried doing but couldn't figure out the correct way to do it, thanks for pointing me in the right direction, everything seems to be working now :)
Hello,
Im trying to support both tsl and std in a single class as follows:
However this gives me:
the template parameter list for class template 'tsl::sparse_map' does not match the template parameter list for template parameter
Apparently because of two non-class parameters at the end of tsl's template. Is there a workaround for this? sparse_pg_map works but not sparse_map.