Big annoyance in TR1

M

Mirco Wahab

Best wishes for 2008!

After studying the fine print
for the "Next Big Thing (tm)"
I *still* found no word about
one big issue, the "raw string"
or "verbatim string" etc.

Whats so complicated with this
little detail? After working
a while with the Boost::Regex
(which goes into TR1), I have
to say - it's like to repaper a
room through the keyhole in it's
door - i end up writing and testing
the regular expression in Perl and
converting the result then by doubling
it's length by added backslashes - to
C++ strings.

Maybe somebody can enlighten me
whats wrong with raw strings
(as every other single language
of some importance nowadays has
them).

What about

char stuff[] = R' this is verbatim (\s* \w+ \s* $)';


Thanks and regards

Mirco
 
J

James Kanze

After studying the fine print
for the "Next Big Thing (tm)"
I *still* found no word about
one big issue, the "raw string"
or "verbatim string" etc.
Whats so complicated with this
little detail? After working
a while with the Boost::Regex
(which goes into TR1), I have
to say - it's like to repaper a
room through the keyhole in it's
door - i end up writing and testing
the regular expression in Perl and
converting the result then by doubling
it's length by added backslashes - to
C++ strings.

The TR was purely library, and didn't consider any changes to
the basic language. The current draft has nothing less than 10
different types of string literal, including 5 for raw strings.
Basically (if I've understood correctly):

escapes
prefix recognized type encoding

<nothing> yes char impl. def.
u8 yes char UTF-8
u yes char16_t UTF-16
U yes char32_t UTF-32
L yes wchar_t impl. def.
R no char impl. def.
u8R no char UTF-8
uR no char16_t UTF-16
UR no char32_t UTF-32
LR no wchar_t impl. def.

This was only really integrated into the draft in the last year
or so, so probably isn't yet implemented in very many, if any
compilers. (In an ideal world, only the u8 and U variants would
be used. But history can't be ignored.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top