67. constexpr-ii

Question.2

Compare two approaches to a MAX utility:

Macro:

#define MAX(a,b) ((a)>(b)?(a):(b))

constexpr:

constexpr int max_val(int a, int b) {
   return (a > b) ? a : b;

}

A developer calls MAX(3.14, 2) and max_val(3.14, 2). What happens?

Need Help? Refer to the Quick Guide below

Select Answer