Multi-character constant warnings

前端 未结 6 1505
别那么骄傲
别那么骄傲 2020-11-22 09:26

Why is this a warning? I think there are many cases when is more clear to use multi-char int constants instead of \"no meaning\" numbers or instead of defining const variabl

6条回答
  •  [愿得一人]
    2020-11-22 09:59

    Even if you're willing to look up what behavior your implementation defines, multi-character constants will still vary with endianness.

    Better to use a (POD) struct { char[4] }; ... and then use a UDL like "WAVE"_4cc to easily construct instances of that class

提交回复
热议问题