mardi 15 juin 2021

C++11 auto and decltype

when reading about auto and decltype (C++11) i see the below function

auto findMin(A a, B b) -> decltype(a < b ? a : b)
{
    return (a < b) ? a : b;
}

this part -> decltype(a < b ? a : b) is strange to me. what kind of function declaration or it just applies for auto and decltype only ?

Aucun commentaire:

Enregistrer un commentaire