[Libreoffice-commits] core.git: Changes to 'private/jmux/multi-index-5-1'

Stephan Bergmann sbergman at redhat.com
Thu Jun 18 01:33:48 PDT 2015


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.)


More information about the LibreOffice mailing list