lundi 29 juin 2020

Why i am not able to create the Unique pointer

I get c2664 error when i try to create a unique pointer

i did write the copy constructor as well as assignment operator but still i keep getting the 2664 error

class UndoCopyPaste : public UndoRedo
    {
    private:
        Container containerValue;
        bool valid;
    public:
        UndoCopyPaste() = default;
        UndoCopyPaste(Container* cont, std::string type);
        UndoCopyPaste(Container trans, Container* cont, std::string type);
        
    };
    
    class UndoRedo
    {
    private:
        std::string type;
    protected:
        Container* container;
    public:
        UndoRedo() = default;
        UndoRedo(Container* cont, std::string undoType);
    };
    
    std::unique_ptr<UndoCopyPaste> undoCopyPastePointer = std::make_unique<UndoCopyPaste>(new UndoCopyPaste()); // error C2664: 'UndoCopyPaste::UndoCopyPaste(UndoCopyPaste &&)': cannot convert argument 1 from '_Ty' to 'const UndoCopyPaste &'

Aucun commentaire:

Enregistrer un commentaire