Illegal token on right side of ::
My guess is that max has been made a macro. This happens at some point inside windows.h. Define NOMINMAX prior to including to stop windows.h from doing that. EDIT: I’m still confident this is your problem. (Not including <limits> would result in a different error). Place #undef max and #undef min just before the function … Read more