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  |
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.
|
|
|
Goto Forum:
Current Time: Tue Jul 01 20:28:10 CEST 2025
Total time taken to generate the page: 0.04000 seconds
|