R
Ramon F Herrera
This is posted only out of curiosity, because as you will see, the
problem (bug? feature?) can be easily worked around.
I am coding some parsing regular expressions, and discovered that
trying to concatenate two consecutive 'chars' is not liked by the
compiler:
const char left_paren = '(';
const char right_paren = ')';
const line = "[AbcDef]";
This type of expression is not good:
const string expression = left_parent + left_paren + line +
right_paren + right_paren;
but it can be fixed like this:
const temp = left_paren + line + right_paren;
const expression = left_paren + temp + right-paren;
The expression may be also fixed by using strings instead of chars:
const string left_paren = "(";
const string right_paren = ")";
TIA,
-Ramon
problem (bug? feature?) can be easily worked around.
I am coding some parsing regular expressions, and discovered that
trying to concatenate two consecutive 'chars' is not liked by the
compiler:
const char left_paren = '(';
const char right_paren = ')';
const line = "[AbcDef]";
This type of expression is not good:
const string expression = left_parent + left_paren + line +
right_paren + right_paren;
but it can be fixed like this:
const temp = left_paren + line + right_paren;
const expression = left_paren + temp + right-paren;
The expression may be also fixed by using strings instead of chars:
const string left_paren = "(";
const string right_paren = ")";
TIA,
-Ramon