#include
int main()
{
const std::string exclam = \"!\";
const std::string message = \"Hello\" + \", world\" + exclam;
std::cout <&l
The problem is that basic string literals like "this is a literal" are not of type std::string so they do not concatenate with the + operator.
In post C++14 you can use standard user defined string literals that are of type std::string:
using namespace std::literals; // somewhere in the scope
auto message = "Hello"s + ", world"s; // message is type std::string
See std::literals::string_literals::operator""s.