Yes. Since std :: min is a function, f (x) and g (x) will be evaluated only once. And the returned values will not be copied. See Function Prototype:
template<typename T>
const T& min ( const T& a, const T& b );
This is a clear distinction with a mini macro defined by a preprocessor:
source
share