Re: [C++]: Multiple inheritage/Conflicts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/11/7 denilsson31 <denilsson31@xxxxxxxxxx>:
>
> Thanks for giving your time, Dario.
>
> It seems it can't since 'int close()' should be public.
>
> Could it be a gcc's bug ?
>

I don't have the Qt sdk at hand, but the following test code works for
me (with gcc 4.3.2):

========
class QFile {
    public:
        virtual void close();
};

class QTemporaryFile : public QFile {
};

class dbFile {
    public:
        virtual int close() = 0;
        static int ok;
};

class dbFileWrapper : public dbFile
{
    private:
        virtual void doClose() = 0;
        int close()
        {
            doClose();
            return dbFile::ok;
        }
};

class TemporaryDbFile : public QTemporaryFile, public dbFileWrapper
{
    private:
        void doClose()
        {
            QTemporaryFile::close();
        }
};
========

   Dario


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux