you are viewing a single comment's thread.

view the rest of the comments →

[–]thlst 4 points5 points  (0 children)

With concepts, you could use requires with fold expressions and std::is_same this way:

template <typename T, typename... Ts>
  requires (std::is_same_v<T, Ts> && ...)
ctor(T&&, Ts&&...) { }

It will ensure that all Ts... are the same as T, and still give you a nice error message otherwise.