Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost mpl string

Hi in boost mpl documentation I have discovered mpl::string and the following example:

typedef mpl::string<'hell','o wo','rld'> hello;

I'm a little bit surprised because I thought that in C or C++ we can't have more than one character between the character ' ?

Is it normal and valid ?

like image 287
Guillaume Paris Avatar asked Apr 25 '11 10:04

Guillaume Paris


1 Answers

Yes, it is valid C++. From any existing C++ standard, section [lex.conn]:

An ordinary character literal that contains more than one c-char is a multicharacter literal. A multicharacter literal has type int and implementation-defined value.

like image 90
Yakov Galka Avatar answered Nov 15 '22 16:11

Yakov Galka