Home » U++ Library support » U++ Core » Inconsistency between Vector and Index
Inconsistency between Vector and Index [message #52130] |
Tue, 23 July 2019 03:34 |
Novo
Messages: 1358 Registered: December 2006
|
Ultimate Contributor |
|
|
Vector<int> vi = {1, 2, 3};
Vector<Vector<int>> vvi;
Index<Vector<int>> ivi;
vvi.Add(vi); // clones vi.
ivi.Add(vi); // fails to compile
Vector::Add implicitly clones its argument. This is what Index::Add used to do in the past.
New Index will now ask you what exactly you want to do with the argument (pick or clone).
IMHO, this is inconsistent.
IMHO, nothing is supposed to be "secretly" cloned behind the scene.
I would say that current behavior of Vector::Add is incorrect.
Just my two cents.
Regards,
Novo
|
|
|
Goto Forum:
Current Time: Fri Apr 26 09:18:39 CEST 2024
Total time taken to generate the page: 0.05259 seconds
|