#include <iomanip>
#include <iostream>
int main()
{
std::cout << std::quoted("To quote: \"Hello.\" ");
std::cout << "To quote: \"Hello.\" ";
std::cout << std::endl;
return 0;
}
// Output: "To quote: \"Hello.\" "To quote: "Hello."
Reference: https://en.wikipedia.org/wiki/C%2B%2B14#Smaller_library_features
Tuesday, October 3, 2017
C++14: The std::quoted
C++14 allows you to quote strings. Here is an example:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment