Bart Weststrate wrote: ↑Sun Jun 08, 2025 10:02 am
Looks nice. When building in VS 2022 it doesn't recognize the clamp function in eval. What to do?
Edit i changed it to this:
// Make sure eval doesn't exceed mate score
//score = clamp(score, -EvalLimit, EvalLimit);
if (score < -EvalLimit) score = -EvalLimit;
if (score > EvalLimit) score = EvalLimit;
I hope that behaves the same...
std::clamp() is a C++20 function, when you set MSVC in the project properties to C++20 it will recognize std::clamp().
Make sure to include <algorithm>, that's where it is defined.
Thans Joost, old Warrior So it's in a package (or option) that isn't installed (yet). I will dive into that.
Can you tell if my replacing code does the same?
Bart, long time no see. Yes, your code does the same. You don't have to install anything, it's just a setting in the compiler options:
Configuration Properties/General/C++ Language Standard
Bart Weststrate wrote: ↑Sun Jun 08, 2025 10:02 am
Looks nice. When building in VS 2022 it doesn't recognize the clamp function in eval. What to do?
Edit i changed it to this:
// Make sure eval doesn't exceed mate score
//score = clamp(score, -EvalLimit, EvalLimit);
if (score < -EvalLimit) score = -EvalLimit;
if (score > EvalLimit) score = EvalLimit;
I hope that behaves the same...
std::clamp() is a C++20 function, when you set MSVC in the project properties to C++20 it will recognize std::clamp().
Make sure to include <algorithm>, that's where it is defined.
Thans Joost, old Warrior So it's in a package (or option) that isn't installed (yet). I will dive into that.
Can you tell if my replacing code does the same?
Bart, long time no see. Yes, your code does the same. You don't have to install anything, it's just a setting in the compiler options:
Configuration Properties/General/C++ Language Standard
Thanks again Joost. That did the trick.
The low nps and output stall was because of compiling to debug mode...