N
Neelesh Bodas
Few questions that have always confused me:
1. is exact match (for overloaded resolution) related to/involves/
needs/means/implies identity conversion?
2.
void foo(int &x);
void bar(int x);
int main()
{
int s = 10;
foo(s); //exact match or reference binding?
bar(s); //exact match or lvalue-to-rvalue-conversion?
}
3.
void foo(int (&arr)[10]);
int main()
{
char s[] = "hello";
foo(s); //exact match or reference binding? Please explain why.
}
Thanks
-Neelesh
1. is exact match (for overloaded resolution) related to/involves/
needs/means/implies identity conversion?
2.
void foo(int &x);
void bar(int x);
int main()
{
int s = 10;
foo(s); //exact match or reference binding?
bar(s); //exact match or lvalue-to-rvalue-conversion?
}
3.
void foo(int (&arr)[10]);
int main()
{
char s[] = "hello";
foo(s); //exact match or reference binding? Please explain why.
}
Thanks
-Neelesh