Home » U++ Library support » U++ Core » Copy the content of a SortedVectorMap
Copy the content of a SortedVectorMap [message #60732] |
Wed, 07 August 2024 19:52  |
 |
forlano
Messages: 1213 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
I have two SortedVectorMap
SortedVectorMap<int, PlayerTB> TBVega, TBS;
where
class PlayerTB : Moveable<PlayerTB> {
public:
int id;
int rank;
Vector<String> tbs;
PlayerTB() {}
};
At some moment I would like that the content of TBVega be identical to that of TBS but without loosing/destroying the content of TBS.
Of course I can iterate and copy one by one the elements. I would like to know if there is some efficient way to do it. I read about clone but the compiler complain things that I do not understand. Perhaps I need to do something on class PlayerTB.
note: copy constructor of 'PlayerTB' is implicitly deleted because field 'tbs' has a deleted copy constructor
Vector<String> tbs;
^
C:\upp/uppsrc/Core/Vcont.h:290:2: note: copy constructor is implicitly deleted because 'Vector<Upp::String>' has a user-declared move construct
or
Vector(Vector&& v) { Pick(pick(v)); }
^
Thanks,
Luigi
[Updated on: Wed, 07 August 2024 19:53] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu Aug 07 19:40:30 CEST 2025
Total time taken to generate the page: 0.00757 seconds
|