Skip to content

CS_Offer/Coding/C++_Smart_Pointer.cpp 第78行并不会调用赋值运算符 #31

Description

@eksea

CS_Offer/Coding/C++_Smart_Pointer.cpp 第78行并不会调用赋值运算符,而是调用拷贝构造函数

如果要调用复制运算符,可以改成

        SmartPtr smpt3(new Cons(3, 4));
        smpt3 = smpt1;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions