-->
Page 1 of 1

R"=====( . . . . )=====" Question

PostPosted: Mon Sep 14, 2015 3:47 pm
by eldonb46
For a while now, I have been using the little known <R"=====( . . . . )====="> Macro to assign large blocks of data within my Arduino IDE Esp Sketches. This Macro is used in several Examples, and Discussed in several threads within this Forum. For example See: http://www.esp8266.com/viewtopic.php?p=27964#p27964

But where can I find the R Macro Documentation, via this Forum, or via Google, that describes it "proper" use or definition? And, Where/How is it implemented?

Thanks,
Eldon - WA0UWH

Re: R"=====( . . . . )=====" Question

PostPosted: Tue Sep 15, 2015 2:05 am
by igrr
This isn't a macro, it's just a part of the language (introduced in C++11 standard), known as raw string literal.

Raw string literals look like
R"token(text)token"

the sequence )token must be chosen such that it doesn't appear inside text. In the example you mentioned this token is five equals signs.

http://en.cppreference.com/w/cpp/langua ... ng_literal

Re: R"=====( . . . . )=====" Question

PostPosted: Tue Sep 15, 2015 1:30 pm
by eldonb46
igrr wrote:This isn't a macro, it's just a part of the language (introduced in C++11 standard), known as raw string literal.

http://en.cppreference.com/w/cpp/langua ... ng_literal


THANKS, igrr,

That solves a BIG mystery for me.

Eldon - WA0UWH