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


Hello Nigel,

On Wed, 2010-11-10 at 17:12 +0000, Nigel Hawkins wrote:
Hi,

This should address the first item in the "removal of duplicate template
classes in calc filter code" section from the easy hacks page.

Not quite a simple search-and-replace but pretty close.

Yup, good work. :-)  Just reviewed and committed as is.

The second item (ScfNoInstance) is slightly more involved. All of the
classes derived from ScfNoInstance are just collections of static
methods and none of them are derived from. Since C++ doesn't support
declaring classes as static, I'm thinking that converting those classes
to namespaces is the correct route? (My C++ skills are a bit rusty).

You could make them non copyable first, then declare their constructor
private and leave the constructor undefined.  This way when someone
tries to instantiate those classes the compiler would fail to link due
to undefined definition.

So, you could do stuff like

class SomeStaticClass : private boost::non_copyable
{
private:
    SomeStaticClass(); // no definition, just declaration.
..

to make the class non-instantiable.

I wouldn't replace them with namespaces, but that's just my personal
preference & I don't see namespaces used like that in this code base.

HTH,

Kohei


Nigel
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

-- 
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>


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.