std::any var = 1;
How can you get the type of var
?
For example:
std::cout << GetTypeOf(var) << std::endl;
Output:
int
std::any var = 1;
How can you get the type of var
?
For example:
std::cout << GetTypeOf(var) << std::endl;
Output:
int
Copyright © 2021 Jogjafile Inc.
Godbolt example
Note that the exact output of
name()
is implementation-defined, so you may geti
instead ofint
for example.