Re: Re: Improving memory management in Calitko

Hi Anders,

I think that if using boost at some places would result in better code, then we should (gradually) refactor existing code and write new code using boost. Since I’ve never actually used boost, I’m quite open to suggestion from you guys, who have boost experience.

I agree with you about passing (const) reference instead of (const) pointer. I would then also add that if passing a pointer is necessary because that expresses passing the ownership of the object to the function, then that must be done using auto_ptr again to make that fact explicit.

Regards,
Peter

anders44 wrote:

Hi again,

boost is a very good template library and I think using it is a good idea but I am not sure whether one should include boost in a project when the project has already progressed so far as yours? Isn’t it tempting to start using a lot of the functionality in boost and rewriting code that may already be running? Worth discussing.

Regarding your coding style; One additional thing that I think would be good would to instead of passing pointers to functions use reference instead. That way several of the if (arg=null).. can be removed as well it forces the caller to supply proper arguments.

BR/andersk

Would you like to post a relpy?


This post is a reply to:
Re: Improving memory management in Calitko
Hi again, boost is a very good template library and I think using it is a good idea but I am not sure whether one should include boost in a project when (more...)

No follow-ups yet.