[Solved] Cant tell why is there any problen with “std::min” function CPP [duplicate]


The problem here is that the algorithm requires that the comparison function would satisfy the requirement of the strict weak ordering. It means that for example if comp( a, b ) is true then comp( b, a ) is not true. However in your call of the algorithm comp( x, y ) where comp is the lambda expression is true and comp( y, x ) is also true. It seems that in the debug mode the compiler switches on such a check of the comparison function.

6

solved Cant tell why is there any problen with “std::min” function CPP [duplicate]