M
marco_segurini
Hi,
I am wondering if there is a way to use the ternary operator to select
a function, between two, even if at least one of them is overloaded.
Ex:
void f1(int) {}
void f1(double) {}
void f2(int) {}
//void f2(double) {}
int main()
{
bool bTest = false;
(bTest ? f1 : f2)(int(1)); // this statement does not compile
return 0;
}
TIA.
Marco
I am wondering if there is a way to use the ternary operator to select
a function, between two, even if at least one of them is overloaded.
Ex:
void f1(int) {}
void f1(double) {}
void f2(int) {}
//void f2(double) {}
int main()
{
bool bTest = false;
(bTest ? f1 : f2)(int(1)); // this statement does not compile
return 0;
}
TIA.
Marco