#include <iostream>
#include <string>
using namespace std;
double stod( const std::string& str, std::size_t* pos = 0 ) { std::cout << "Oops"; }
int main() {
const std::string a("1.2");
std::cout << stod(a) << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmRvdWJsZSBzdG9kKCBjb25zdCBzdGQ6OnN0cmluZyYgc3RyLCBzdGQ6OnNpemVfdCogcG9zID0gMCApIHsgc3RkOjpjb3V0IDw8ICJPb3BzIjsgfQoKaW50IG1haW4oKSB7Cgljb25zdCBzdGQ6OnN0cmluZyBhKCIxLjIiKTsKCXN0ZDo6Y291dCA8PCBzdG9kKGEpIDw8IHN0ZDo6ZW5kbDsKCXJldHVybiAwOwp9
prog.cpp: In function 'int main()':
prog.cpp:10:21: error: call of overloaded 'stod(const string&)' is ambiguous
std::cout << stod(a) << std::endl;
^
prog.cpp:6:8: note: candidate: double stod(const string&, std::size_t*)
double stod( const std::string& str, std::size_t* pos = 0 ) { std::cout << "Oops"; }
^
In file included from /usr/include/c++/5/string:52:0,
from /usr/include/c++/5/bits/locale_classes.h:40,
from /usr/include/c++/5/bits/ios_base.h:41,
from /usr/include/c++/5/ios:42,
from /usr/include/c++/5/ostream:38,
from /usr/include/c++/5/iostream:39,
from prog.cpp:1:
/usr/include/c++/5/bits/basic_string.h:5286:3: note: candidate: double std::stod(const string&, std::size_t*)
stod(const string& __str, size_t* __idx = 0)
^