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 » 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: 13976
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: Wed May 08 17:25:03 CEST 2024

Total time taken to generate the page: 0.02460 seconds