[algorithms][is_valid] attempt to fix MSVC compilation errors