Home » Community » Newbie corner » broken pick semantics
Re: broken pick semantics [message #37821 is a reply to message #37817] |
Thu, 15 November 2012 04:16   |
|
Hi crydev
Your problem with broken pick semantics is not actually on the line with GetCount(). That is just coincidentally the first place when you try to access picked container. You will have to look in the code that is executed before. Check for any copy/assignment of SyncDirectories to another Vector. Vector is by default using pick semantics, so when you copy it, the original content is destroyed.
Read the NTL tutorial, (especially section 3) for basic explanation of picking and also Transfer semantics and Pick behavior explanation for further details. It is some heavy reading, but necessary to understand the U++ containers. When I started to work with U++, I had to read it at least once a day for a week, before I got used to it and understood why is it so great 
Also if you post more of the related code, I should be able to point you more exactly to where the problem started. It is definitely not in the parts that you posted.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Sun Aug 24 23:48:27 CEST 2025
Total time taken to generate the page: 0.09840 seconds
|