I have some type deduction guide issue with a simple class template, that is instantiated issues in the main function scope, but fails to do that inside another class.
Here is an example:
template<class T>
struct X
{
X(T&)
{
}
};
struct User
{
X x{1}; // error: invalid use of template-name 'X' without an argument list
};
int main()
{
int i;
auto x = X(i); // OK
(void)x;
}
I am kind of puzzled, why is that and how this can be fixed. Any ideas?