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


On 30/12/2012 21:48, Markus Mohrhard wrote:
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).
I didn't think that one's want prevent default behaviour without overloading but since it was on purpose, ok for me.

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.
Ok done, see http://cgit.freedesktop.org/libreoffice/core/commit/?id=c183d8c0cdc849673bee180f780604700eac85fb

Thank you again Markus.

Julien


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.