In the following code:
http://coliru.stacked-crooked.com/a/c3ed46591fe7d3af
struct Thingy
{
template<class T1>
void operator=(std::pair<int, T1> p){
}
};
int main()
{
Thingy thing;
thing={1, "asd"};
/*
This works fine:
std::pair<int, int> p(1, "asd");
thing=p;
*/
return 0;
}
I have this error:
couldn't deduce template parameter 'T1'
It seems that list initialization (curly braces) prevents type deduction. But why?