'How to use ... in a class template specialization?
This is an example with ... in the middle position of a template, however I cant understand what it means.
template <typename T, T f> class Invalid;
template <typename T1, typename... Args, T1 (*f)(Args...)>
class Invalid<T1 (*)(Args...), f>
{};
The following also works for me and is easy to comprehend.
template <typename... Args> class Invalid;
template <typename T1, typename... Args>
class Invalid<T1 (*)(Args...), T1>
{};
Why would I use the first one instead of the second?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
