I have a function that takes in a parameter with generic type T. And it will do different things depending on the type of obj
.
template <typename T>
void function(const T& obj)
{
if constexpr (/* is a vector */) {}
else if constexpr (/* is an unordered map */) {}
// ...
else {}
}
So I need to check if the type of obj
is vector
, or unordered_map
, or unordered_set
, etc.
Anyone knows the answer to this? Thanks!