← Back to team overview

kicad-developers team mailing list archive

Re: About today bzr update

 

On Wed, May 16, 2012 at 06:24:39AM -0500, Dick Hollenbeck wrote:
> Without verifying the truth of your statement about copying, I would say iterating over a
> loop should not need to copy objects.

Looking around it seems that the issue is copying *pointers* to the
object when copying the whole collection. 

> BOOST_FOREACH seems truly not to be for everyone as the name would suggest (FOREACH is a
> lie, it is not for me). 
> 
> I've never used it, ever.  If I cannot write the three controlling statements in for loop
> on a standard container, then its time to retire, or find a new container.

IMHO an std::vector<LIBITEM*> would do the trick, but depends on who
'owns' the pointers... it seems that the whole pointer collection
library is made to simplify memory management but, as I said, it's the
first time I open the manpage.

boost probably works well when you implements all the required contracts
(like their clonable instead of our clone and so on) *or* you declare
the proper traits or marker classes (the whole traits issue in C++ is
something I hate a lot). For example they have a 'non copiable' ancestor
to mark all the class which are not to be copied (or something like
that).

Also the error messages when templates are involved are something to panic at :D
Compilation time is also a (minor) issue...

-- 
Lorenzo Marcantonio
Logos Srl


References