The syntax for a string literal of a string is something like this:
R"<delim>(...)<delim>"
An extra separator next to the parentheses exists for exactly the reason you just stumbled. This will allow you to include string control characters in the string. So add a separator:
auto tag = R"tag("("add")")tag";
source
share