Just making sure that it is indeed a bug and not something I might have misunderstood about the functionality of std::quoted
Here is the code that should in my opinion escape double quotes with double quotes and then unescape them back to the original string:
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
int main()
{
std::string s = R"(something"something)";
std::cout << "Original: \t" << s << std::endl;
std::ostringstream oss;
oss << std::quoted(s, '"', '"');
std::string s1 = oss.str();
std::cout << "Quoted: \t" << s1 << std::endl;
std::istringstream iss(s1);
std::string s2;
iss >> std::quoted(s2, '"', '"');
std::cout << "Unquoted: \t" << s2 << std::endl;
return 0;
}
The expected output:
Original: something"something
Quoted: "something""something"
Unquoted: something"something
However this is what I get in VS2017 15.6.6:
Original: something"something
Quoted: "something""something"
Unquoted: something
Could anyone confirm this is a bug?
UPDATE:
Good news everyone. The ticket I filed with MS got marked as fixed
.