if (size > static_cast<size_t>(std::numeric_limits<int>::max())) { will export: Error C2143 syntax error: missing ';' before '{' need change to: if (size > static_cast<size_t>((std::numeric_limits<int>::max)())) {