
#include <string>
#include <type_traits>
#include <iostream>

struct A{
     A(int ,double) {}
};

struct B{
     B(int ,double) {}
};

template<class T=A>
void f(T a,
       typename std::enable_if<std::is_same<T,A>::value>::type* = 0 ){
    std::cout<<"In f(A a)\n";
}

void f(B b){std::cout<<"In f(B b)\n";}

int main(int argc, char**argv)
{
    f({1,2}); //It's not ambiguity anymore and calls f(B a)
    f(A{1,2});//call f(A a)
    f(B{1,2});//call f(B b)
    //f(2); error
}
