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


So I've added a patch on top of the changeset in the spirit of
tdf#75757. No more "using" and "namespace aliases".

I want to profile this change after my holiday. It's actually a
replacement for the whole private/jmux/sorted-pagedesc+spzfrmfmts
changeset and wouldn't introduce the semantic change of a sorted vector.

The original changeset AFAIK showed a 30% faster load time for large MM
documents with many frames and page descriptions and even improved the
general unit test time. I guess that's still the case with the
multi-index structure.

And it survives make check, slowcheck and subsequentcheck on master.

Jan-Marek

Am 18.06.2015 um 10:33 schrieb Stephan Bergmann:
On 06/18/2015 09:32 AM, Miklos Vajna wrote:
One nitpick: please avoid namespace aliases or using statements in
headers[1], currently ~no code does that (com::sun::star -> css is the
only exception, I think), and it helps readability: that way you can
always go to the start of the file and see all of them.

Just mentioning as I guess this affects each class where you add
multi-index support, so it saves time if you get this right from the
very beginning.

[1] https://wiki.openoffice.org/wiki/Writer/Code_Conventions says
"header files, where using-statements are not permitted", AFAIK that's
still true for LO code, too

Beware, though, the differences between

(1) namespace aliases,

  namespace foo = bar::baz;

(2) using declarations,

  using foo::bar;

(3) using directives,

  using namespace foo::bar;

Technically, only (3) is generally problematic in include files (esp. in
global scope), as it pollutes the respective scope with a set of names
that may change over time, for all compilation units including that file.

(1) and (2) introduce single names into a scope; whether to allow them
in include files is more a matter of taste.

(There is no "using-statements" in C++, whatever
<https://wiki.openoffice.org/wiki/Writer/Code_Conventions> wants to talk
about.)


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.