stod does not work correctly with boost::locale
问题 I am trying to use boost::locale and std::stod together in a german locale where a comma is the decimal separator. Consider this code: boost::locale::generator gen; std::locale loc(""); // (1) //std::locale loc = gen(""); // (2) std::locale::global(loc); std::cout.imbue(loc); std::string s = "1,1"; //float string in german locale! double d1 = std::stod(s); std::cout << "d1: " << d1 << std::endl; double d2 = 2.2; std::cout << "d2: " << d2 << std::endl; std::locale loc("") creates the correct