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 » Coffee corner » Basic questions about u++
Re: Basic questions about u++ [message #23298 is a reply to message #23296] Wed, 07 October 2009 18:47 Go to previous messageGo to previous message
irtech is currently offline  irtech
Messages: 7
Registered: October 2009
Promising Member
mrjt wrote on Wed, 07 October 2009 18:14


By wrapping the new/delete calls in an object (one that has already been thoughly tested) you are able to utilise C++ inbuilt destruction mechanics and avoid the error-prone call to delete. There isn't any 'magic' going on outside of using templates in a clever way

As far as I'm concerned the Upp memory management philosophy is to never use new/delete. There is almost always a better way Smile.


Ok thanks with your explanation and what I've read in overview now I understood the resource management philosophy of U++!

except one thing !
Ok your example is about a simple int but hw about a big object like a class? Then you certainly need copy constructor which seems to be the motive not to use stdlib. but not having control over copy constructor isn't a drawback by itself?
I mean for example I want to specifically copy value of a sibling object when copy constructor is called or I want to increment a variable inside a class inside copy constructor so I know how many times it has been copied. How should I implement them? I'm not saying it is a routine task but many times you want to do specialized tasks in copy constructor. Then how you do it?

Regards.


 
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
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: Time to sing praises for MinGW and GCC
Next Topic: online Whiteboard
Goto Forum:
  


Current Time: Mon May 13 18:09:44 CEST 2024

Total time taken to generate the page: 0.02434 seconds