Jun 29, 2020 at 9:25pm UTC
The
auto v1 will assign the first type to
v1 , which in your example is
int .
The
decltype(v1) is therefore int. So the template becomes:
template <int v1, int ...VS>
int... VS is a parameter pack:
https://en.cppreference.com/w/cpp/language/parameter_pack
Where did you get this code? Post the link.
Last edited on Jun 29, 2020 at 9:25pm UTC
Jun 29, 2020 at 9:46pm UTC
It's from a book I recently purchased called "C++ 17 The Complete Guide" by Nicolai Josuttis.
Very good book.
I looked at your link for parameter pack but there is nothing with a type before the ...
all the examples use class or typename but none contain a given explicit type like int in our example.
Does int...VS mean int,int,int, ?
template<class ... Types> struct Tuple {};
Would really appreciate a bit more explanation.
Regards,
Juan
Jun 29, 2020 at 10:03pm UTC
I apologize I was in a hurry. You are correct.
thanks and sorry again
Juan
Jun 29, 2020 at 10:40pm UTC
dutch I was trying to speed up my understanding; the link is large with many scenarios. I wanted a straight answer to a very specific question:
Does int...VS expands to a comma separated list of int?
That 's all i wanted to know - I was going to study your link when I have more time.