|
|
Home » Developing U++ » U++ Developers corner » C2280
C2280 [message #47586] |
Thu, 02 February 2017 12:49  |
NilaT
Messages: 70 Registered: November 2011 Location: Austria
|
Member |
|
|
Hello everyone,
I have another, very urgent question.
I want to compile my project with 2015 sources and MSC15...
Some errors here, some warnings there, not worth be mentioned.
But, one error is very annoying and I can't get rid of it.
It's C2280...
test.cpp (191): error C2280: "Upp::Array<TEST> &Upp::Array<TEST>::operator =(const Upp::Array<TEST> &)" : Es wurde versucht, auf eine gelöschte Funktion zu verweisen
I already found this:
http://stackoverflow.com/questions/31264984/c-compiler-error -c2280-attempting-to-reference-a-deleted-function-in-visual
which says the Array class needs a "= default" constructor and copy constructor or something.
I tried a few things but nothing worked.
Please help.
Very urgent!
Any help appreciated.
Thanks in advance.
PS: Please help me with my other Problem (RPC_METHOD) as well, thank you.
PPS: My exact version of Upp is 10249
//edit: When I change
void operator=(Array&& v) { if(this != &v) { Free(); vector = pick(v.vector); } }
to
Array& operator=(const Array&) = default;
in Vcont.h, the error won't occur but I don't think this is the right solution...
And then the same error occurs for Upp::XmlNode...
Very annoying...
[Updated on: Thu, 02 February 2017 13:01] Report message to a moderator
|
|
|
|
|
|
|
|
Re: C2280 [message #47606 is a reply to message #47602] |
Mon, 06 February 2017 13:15   |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |

|
|
http://www.ultimatepp.org/srcdoc$Core$pick_$en-us.html
U++ style of coding insists on explicit definition what you want to do: to clone object or to move it. You mustn't write trivial code like
b = a;
fot U++ objects because it is hard to say whether you want to clone object or pick/move it from a to b.
P.S. It is rather uncommon for C++, but I do personally like this style. It is more strict and less error prone.
[Updated on: Mon, 06 February 2017 13:16] Report message to a moderator
|
|
|
|
Re: C2280 [message #47619 is a reply to message #47609] |
Thu, 09 February 2017 20:29  |
Didier
Messages: 725 Registered: November 2008 Location: France
|
Contributor |
|
|
Hi,
In fact, the origin of the error is probably readable in the code
==> you may have something like the following:
xxxx operator=(xxxx i) = deleted;
Apparently (I haven't looked precisely) deleted indicates that the code is deprecated but can't be used anymore (it is still present to make it easier to do corrections: if you know what has been removed).
I ran into the same type of error 2 days ago, and all the 'xx operator(const xx t)' where marked deleted ==> notice that only the CONST ones where deleted.
From my point of view these modifications are linked to the management of the move semantics introduced in C++11
[Updated on: Thu, 09 February 2017 20:30] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:12:03 CEST 2025
Total time taken to generate the page: 0.00590 seconds
|
|
|