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.)
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to