mardi 15 septembre 2020

C++11 using delaration for constructor [closed]

I tried to use the using-declaration of C++11 to write the constructor like the following

    class BaseDevice : public DeviceInterface
    {
    public:
        /**
         * @brief Constructor
         */
        BaseDevice();   
         ~BaseDevice(); 
      
    };

class LED : public BaseDevice
    {
    public:
        /**
         * @brief Constructor
         */
        using BaseDevice::BaseDevice;
        ~LED();    
    };

But I got the error from Arm Compiler "a using-declaration may not name a constructor or destructor". Does that mean, arm compiler cannot use derived constructor in C++11?

Aucun commentaire:

Enregistrer un commentaire