[Interest] Q_NO_USING_KEYWORD

Thiago Macieira thiago.macieira at intel.com
Tue May 22 17:24:42 CEST 2012


On terça-feira, 22 de maio de 2012 14.33.37, Graham Labdon wrote:
> Hi
> I am using a QStringList and wanted to use the documented
> 
> indexOf(const QString &str, int from = 0)
> 
> method.
> 
> My compiler did not like this because Q_NO_USING_KEYWORD is not defined.
> I can overcome this by adding the appropriate define in the .pro file -
> 
> DEFINES += Q_NO_USING_KEYWORD
> 
> However, I do  not fully understand the use of Q_NO_USING_KEYWORD and so am
> not sure if this has any other repercussions?
> 
> I would therefore be grateful if someone could explain the use of
> Q_NO_USING_KEYWORD

That keyword exist(ed) for the use with compilers that did not understand the 
"using" keyword properly. The example is:

struct Base {
    void f();
};

struct Derived : public Base {
    using Base::f;
    void f(int);
};

Compilers that do not understand the using keyword are no longer supported and 
really doubt you have one such old beast.

So, more than likely, you've mis-diagnosed the problem.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120522/04185a5c/attachment.sig>


More information about the Interest mailing list