warning C4003 and errors C2589 and C2059 on: x = std::numeric_limits::max();

前端 未结 6 1114
梦毁少年i
梦毁少年i 2020-12-04 21:28

This line works correctly in a small test program, but in the program for which I want it, I get the following compiler complaints:

#include 

         


        
6条回答
  •  日久生厌
    2020-12-04 21:56

    Other solution would be to wrap function name with parenthesis like this: (std::numeric_limits::max)(). Same applies to std::max.

    Not sure it's good solution for this... NOMINMAX is better IMO, but this could be an option in some cases.

提交回复
热议问题