私は次のコードに興味があります、なぜそれが最初にbool funcを呼び出すのか誰かが説明できますか?「str」はargタイプの文字列に適していませんか?
void a(bool input)
{
cout<<"I amd first"<<endl;
cout<<input<<endl;
}
void a(const string &input)
{
cout<<"I amd second"<<endl;
cout<<input<<endl;
}
int main( )
{
a("str"); // call void a(bool input)
a(string("str")); //call void a(const string &input)
return 0;
}