You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
255 B
17 lines
255 B
4 years ago
|
|
||
|
|
||
|
constexpr int func(int A, int B)
|
||
|
{
|
||
|
#if defined(_MSC_VER) && _MSC_VER < 1913
|
||
|
// no suppport for extended constexpr
|
||
|
return B * A;
|
||
|
#else
|
||
|
// Verify that we have at least c++14
|
||
|
if (A < B) {
|
||
|
return A + B;
|
||
|
} else {
|
||
|
return B * A;
|
||
|
}
|
||
|
#endif
|
||
|
}
|