for (size_t i = 0; i < 2; ++i) {
LPCTSTR link[]{ L"url-to-file-with-OK/base.txt" , L"url-to-file-with-NO/base-1.txt" };
auto res = URLDownloadToFile(NULL, link[i], L"Debug\\base.txt", NULL, NULL);
if (res == S_OK) {
std::cout << "result: OK" << std::endl;
}
else {
std::cout << "result: not good" << std::endl;
}
std::ifstream f("Debug\\base.txt");
std::stringstream ss;
ss << f.rdbuf();
f.close();
std::cout << ss.str() << std::endl;
}
result: OK
OK
result: OK
NO
if (ss.str() == "OK\n")
std::cout << "Correct comparison" << std::endl;
result: OK
OK
Correct comparison
Но в моём коде всё нормально.
template <>
double func<double, int> (double a, int b){
return a + b;
}