vendredi 2 janvier 2015

C++ specify non-templated version of function when calling

I wonder, is there a way to force calling non-template function, like:



template <class T>
void foo(T&);

void foo(const int&);

void bar()
{
int a;
foo(a) // templated version is called, not a usual function
}

Aucun commentaire:

Enregistrer un commentaire