error: use of deleted function

前端 未结 6 1375
滥情空心
滥情空心 2020-12-02 08:00

I\'ve been working on some C++ code that a friend has written and I get the following error that I have never seen before when compiling with gcc4.6:

error:          


        
6条回答
  •  天命终不由人
    2020-12-02 08:30

    You are using a function, which is marked as deleted.
    Eg:

    int doSomething( int ) = delete;
    

    The =delete is a new feature of C++0x. It means the compiler should immediately stop compiling and complain "this function is deleted" once the user use such function.

    If you see this error, you should check the function declaration for =delete.

    To know more about this new feature introduced in C++0x, check this out.

提交回复
热议问题