Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hey,


Cppcheck reported this:
[reportdesign/source/filter/xml/xmlComponent.hxx:37]: (style)
'OXMLComponent::operator=' should return 'OXMLComponent &'.
[reportdesign/source/filter/xml/xmlFunction.hxx:41]: (style)
'OXMLFunction::operator=' should return 'OXMLFunction &'.
[reportdesign/source/filter/xml/xmlGroup.hxx:38]: (style)
'OXMLGroup::operator=' should return 'OXMLGroup &'.
[reportdesign/source/filter/xml/xmlCell.hxx:41]: (style)
'OXMLCell::operator=' should return 'OXMLCell &'.

By trying to fix these, I noticed that none of them was implemented. So can
they just be removed, is it another C++ "trick", or something obvious I
missed?


You can't remove them. They are declared there to prevent the default
operator= and copy c'tor. If you don't declare them private and leave
out the implementation the compiler will generate a default operator=
(the same is true for the copy c'tor).

But you can of course change the signature of the operator even when
it does not matter in that case as these will not be implemented.

Regards,
Markus

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.