I'm new with templates, specially with parameter pack and I wonder if I can get the first value from the pack.
For example the following code:
template <typename T, typename... Args>
bool register(Args... args) {
if (!Foo<T>(args..) {
assert(std::is_same_v<std::string, args...[0]>);
std::cerr << "Failed call Foo with " + args...[0] + "\n";
}
}
How do I really get the first value in args...
?
Worth to note that args..
. can contain different types (string, boolean, etc.)