This code fails because the compiler thinks template arguments for Test is an empty set.
#include <tuple>
template <typename... T>
class Test
{
public:
template <typename Arg, typename... Args>
Test(Arg&& arg1, Args&&... args) : tuple_{std::forward<Arg>(arg1), std::forward<Args>(args)...}
{}
private:
std::tuple<T...> tuple_;
};
template <typename... Ts>
Test(Ts...) -> Test<Ts...>;
int main()
{
Test t{1, 2};
}
why is that? Live example
Changing deduction guide to "fully match" the constructor works on the other hand