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 » Avoid Copy when adding a Tuple to a VectorMap
Re: Avoid Copy when adding a Tuple to a VectorMap [message #57624 is a reply to message #57183] Mon, 11 October 2021 07:19 Go to previous message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 227
Registered: June 2011
Experienced Member
I just realized I didn't really answer your question, but this might help with what you're doing:

#include <Core/Core.h>

using namespace Upp;

class A : Moveable<A> {
    public:
        A(int e) : d_e(e){}
        int d_e;
};

CONSOLE_APP_MAIN
{
    VectorMap<int, Tuple<int, A>> myVector;
    myVector.AddPick(1, MakeTuple(1, A(5)) );
	
    Cout() << myVector.Get(1).b.d_e << EOL;
}


I know AddPick uses move constructor but I'm not sure what you get out of it, although you may find MakeTuple useful from a clarity standpoint.
 
Read Message
Read Message
Read Message
Previous Topic: skylark
Next Topic: How to migrate my old packages to new version U++ in linux
Goto Forum:
  


Current Time: Tue Jul 01 20:28:10 CEST 2025

Total time taken to generate the page: 0.04000 seconds