Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » [Solved]Vector<Vector<int>> problem
Re: Vector<Vector<int>> problem [message #53062 is a reply to message #53045] Tue, 18 February 2020 18:43 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1430
Registered: December 2006
Ultimate Contributor
bozero wrote on Sun, 16 February 2020 23:21

The code is working on upp-mingw-11873,

This code is not supposed to compile with any compiler and latest version of Upp.
There are two issues with this code.
1. You are supposed to tell explicitly what you want to do with your Vector.
	vvi.Add(clone(vi1));
	vvi.Add(pick(vi2));

In the first case you are making a copy, in second - moving.
2. There is a problem with
Vector&  operator<<(const T& x)

It is supposed to look like below. This version of operator<< is missing.
Vector&  operator<<(T&& x)  { Add(pick(x)); return *this; }


In this case you would be able to write
vvi << pick(vi1) << pick(vi2);

Hope this helps.


Regards,
Novo
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Get volume name of shares ...
Next Topic: error: call to implicitly-deleted copy constructor
Goto Forum:
  


Current Time: Thu Jul 31 19:05:40 CEST 2025

Total time taken to generate the page: 0.05598 seconds