13

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 ?

Guillaume Paris
  • 10,303
  • 14
  • 70
  • 145

1 Answers1

11

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.

Yakov Galka
  • 70,775
  • 16
  • 139
  • 220