C++ Logo


Advanced search

Subject: Re: [std-proposals] Proposal - Allow any character between double quotes for strings.
From: Domen Vrankar (domen.vrankar_at_[hidden])
Date: 2020-03-05 00:32:18

On Thu, Mar 5, 2020, 1:27 AM J Decker via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> There's (IMO) not a lot of reason to terminate a string because end of
> line characters are encountered...

Backward compatibility and the fact that std C functions expect it?

You should use std::string_view or std:: string APIs for such cases.

> Allow any character other than a " in quoted strings. The " character
> itself needs to be escaped \" if included in " to a closing ". All
> regular escape handling can be done, but other literal characters like
> '\t' or '\n' that are in the source between quotes should be included as
> that literal character.

See raw C++ string literals. The were introduced in C++11 and should cover
your use cases.


> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups