Kay Ramme - Sun Germany - Hamburg wrote: > Hi developers, > > Ause made me recently aware of the fact, that ambiguities regarding the > RTL Reference type (sal/inc/rtl/ref.hxx - rtl::Reference) and the Uno > Reference type (cppu/inc/com/sun/star/uno/Reference.h - > com::sun::star::uno::Reference) are showing up more frequently, because > of some (don't know yet which) changed headers now including the RTL > Reference, precompiled headers (I actually have to admit, that I don't > know the exact relationship yet) and multiple "using" declarations. > > E.g. > #include "myheader.hxx" > > using rtl; > using com::sun::star::uno; > > ... > > Reference<XBla> xBla; > > ... > > did compile as long as myheader.hxx did not include (neither directly > nor indirectly) rtl/ref.hxx . Somehow adding rtl/ref.hxx now leads to > ambiguities because of the unclear usage of "Reference". > > I briefly talked to Malte, Matthias Huetsch and Michael Brauer about > this, and we found various possible solutions leading to disambiguate > resolution, from which we favored the following. > > We assume, that people using "using rtl;" mostly intend to use the RTL > string and string buffer classes. Therefor we suggest to just be a > little bit more precise regarding the things being "usable" from the RTL > namespace, by making the "using rtl;" somewhat more precise: > > using rtl::OUString; > using rtl::OUStringBuffer; > > respectively everything else :-)
Honestly speaking I doubt that the three letters "rtl" are worth a "using" declaration at all. I always prefer to use the fully qualified names. In conjunction with "using namespace com::sun::star" as the only "using" directive in my files I never get any clashes and OTOH get a manageable namespace overhead in my source code. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
