std::max() and std::min() not constexpr

后端 未结 5 1836
臣服心动
臣服心动 2020-12-10 23:31

I just noticed that the new standard defines min(a,b) and max(a,b) without constexpr.

Examples from 25.4.7, [

5条回答
  •  温柔的废话
    2020-12-11 00:11

    std::min and std::max are constexpr in C++14, which obviously means there isn't a good reason (these days) not to have them constexpr. Problem solved :-)

提交回复
热议问题