← Back to team overview

kicad-developers team mailing list archive

Re: About today bzr update

 

On 05/16/2012 03:24 AM, Lorenzo Marcantonio wrote:
> Merged from the tip. Problem of the day :P
>
> You declared
>
> typedef boost::ptr_vector< LIB_ITEM > LIB_ITEMS;
>
> ... which is an IMHO more than reasonable decision.
>
> drawings in LIB_COMPONENT is a LIB_ITEMS.
>
> Then in (for example) GetBoundingBox I have an issue on the
>
> BOOST_FOREACH( const LIB_ITEM& item, drawings )
>
> ... obviously because LIB_ITEM is abstract and then you can't take
> a reference to it (more precisely, it wants to copy it so the copy
> construction is invalid)

Without verifying the truth of your statement about copying, I would say iterating over a
loop should not need to copy objects.

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.


Dick




Follow ups

References