Al obtener el máximo de var, ¿cuál es la diferencia entre usar la función y la macro?
Leyendo el código de combase.cpp, encuentro lo siguiente:
/* We have to ensure that we DON'T use a max macro, since these will typically */
/* lead to one of the parameters being evaluated twice. Since we are worried */
/* about concurrency, we can't afford to access the m_cRef twice since we can't */
/* afford to run the risk that its value having changed between accesses. */
template<class T> inline static T ourmax( const T & a, const T & b )
{
return a > b ? a : b;
}
No entiendo por qué "max macro hace que uno de los parámetros se evalúe dos veces".