You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In first example you can't do that for a function, but you can for a class:
template <int ... IntSeq>
classA {}; // Ok
For functions you can use variadic templates with SFINAE type check or with requires (C++20) or as it is written below with auto, it seems to be called "abbreviated function templates", but specifically as it is written here, it doesn't work that way.
In first example you can't do that for a function, but you can for a class:
For functions you can use variadic templates with SFINAE type check or with
requires
(C++20) or as it is written below withauto
, it seems to be called "abbreviated function templates", but specifically as it is written here, it doesn't work that way.I believe this solution should work below С++20:
The first example from slide will generate an error:
g++ main.cpp -Wall -std=c++23 && ./a.out
Output:
The text was updated successfully, but these errors were encountered: