U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » Please help! New transfer semantic issue!
Re: Please help! New transfer semantic issue! [message #46201 is a reply to message #46174] Fri, 25 March 2016 18:54 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
I you want to maintain pick/clone distinction, you should implement "clone" constructor/operator:

    Line(const Line& ln, int):p1(ln.p1),p2(ln.p2), elp1(???),elp2(???),
                      segs(clone(ln.segs)), // make a deep copy 
                      lines(clone(ln.lines))  // ditto
                     {}
// and operator=....


If you do not care, you can also use WithDeepCopy

...
WithDeepCopy<Array<Segment> > segs;
...


Things might get simpler with C++11...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: conversion from String to wchar_t
Next Topic: How to handle a lack of memory
Goto Forum:
  


Current Time: Fri Sep 04 09:25:39 GMT+2 2026

Total time taken to generate the page: 0.00909 seconds