Post Go back to editing

Designated Initializers don't work in C++11 mode

Designated Initializers works in C and C++ mode, but it don't work in C++11 mode.

Why?

"An_absolute_file_path\file_name.cpp", line 149: cc0040: error: expected an identifier

[0 + 0] { (u32)(&zero0), 0x00000000 }, // 000: zero signal

 ^

"An_absolute_file_path\file_name.cpp", line 149: cc0065: error: expected a ";"

[0 + 0] { (u32)(&zero0), 0x00000000 }, // 000: zero signal

                                                          ^

Parents
  • Designated initializers are a C99 feature. We've enabled them by default as an extension where possible. Unfortunately there is an overlap between C++11 lambda expressions (new for C++11) and designated initializers syntax. This means designated initializers cannot be used in C++11 mode.

    Regards,

    Stuart.

Reply
  • Designated initializers are a C99 feature. We've enabled them by default as an extension where possible. Unfortunately there is an overlap between C++11 lambda expressions (new for C++11) and designated initializers syntax. This means designated initializers cannot be used in C++11 mode.

    Regards,

    Stuart.

Children
No Data