How to correctly fix “zero-sized array in struct/union” warning (C4200) without breaking the code?

后端 未结 6 1398
北海茫月
北海茫月 2021-02-05 07:52

I\'m integrating some code into my library. It is a complex data structure well optimized for speed, so i\'m trying not to modify it too much. The integration process goes well

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 08:18

    If it's complaining about the copy constructor and assignment operator functions, couldn't you supply your own. If you don't want them, declare them private.

    This may produce a lot of errors elsewhere in the code if you are assigning or copying without realising it, in which case it wouldn't have worked anyway because there are no automatically generated ones.

提交回复
热议问题