Ao obter o max var, qual é a diferença entre usar a função e macro
lendo o código combase.cpp, eu encontro o seguinte:
/* 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;
}
Eu não entendo porque "max macro leva a um dos parâmetros sendo avaliados duas vezes"?