Automatic using ::rtl::OUString etc.

Stephan Bergmann sbergman at redhat.com
Thu Apr 12 23:21:35 PDT 2012


On 04/12/2012 03:59 PM, Lubos Lunak wrote:
>   would somebody see a problem with this?
>
> sal/inc/rtl/ustring.hxx :
> +#ifdef RTL_AUTOMATIC_USING
> +using ::rtl::OUString;
> +using ::rtl::OStringToOUString;
> +using ::rtl::OUStringToOString;
> +#endif

I am not too excited about this.

For one, we need to ensure that none of the URE published interface 
implicitly relies on -DRTL_AUTOMATIC_USING.  (And it is not clear to me 
that compiling the sal library with -URTL_AUTOMATIC_USING could even 
catch all problems in sal headers.)

For another, it increases accidental complexity (an ifdef block; yet 
another -D always passed in) for IMO little gain.

And for a third, it introduces a magic special case (certain names from 
the rtl namespace can be used without qualification; without this being 
evident from the C++ source code itself, as it relies on .mk file 
behavior; but there is an exception, that this special case must not be 
used in certain headers).

Stephan


More information about the LibreOffice mailing list