Using C++11's std::stoi() to convert a std::string to an integer in toValue<int>().