Andrew Hain | 28 Aug 19:10

[pointer container] Wishlist: Iterating through nullable vectors and compiler firewalls

Two quick queries.

Would it make sense to have the iterator increment and decrement operators and 
begin() member function of ptr_vector< nullable<> > skip missing records so 
that applications have no need to check?

What is stopping pointer container classes from being used with opaque types 
as a compilation firewall?

--
Andrew Hain
Oasys
http://www.oasys-software.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Thorsten Ottosen | 28 Aug 21:07

Re: [pointer container] Wishlist: Iterating through nullable vectors and compiler firewalls

Andrew Hain skrev:
> Two quick queries.
> 
> Would it make sense to have the iterator increment and decrement operators and 
> begin() member function of ptr_vector< nullable<> > skip missing records so 
> that applications have no need to check?

Well, it is always a design trade-off. If we did that, then people who 
need to know the index of the null value is in trouble.

I do think it would make sense to add some utility iterator/range:

boost::ptr_vector<T> vec;
...
BOOST_FOREACH( T& e, boost::filter_nulls(vec) )

or something. I'm open to naming ideas :-)

> What is stopping pointer container classes from being used with opaque types 
> as a compilation firewall?

Can you be more specific? I have some trouble knowing the precise problem.

Thanks

-Thorsten
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

(Continue reading)

Andrew Hain | 31 Aug 15:52

Re: [pointer container] Wishlist: Iterating through nullable vectors and compiler firewalls

Thorsten Ottosen <thorsten.ottosen <at> dezide.com> writes:

> 
> Andrew Hain skrev:
> > Two quick queries.
> > 
> > Would it make sense to have the iterator increment and decrement operators 
and 
> > begin() member function of ptr_vector< nullable<> > skip missing records so 
> > that applications have no need to check?
> 
> Well, it is always a design trade-off. If we did that, then people who 
> need to know the index of the null value is in trouble.
> 
> I do think it would make sense to add some utility iterator/range:
> 
> boost::ptr_vector<T> vec;
> ...
> BOOST_FOREACH( T& e, boost::filter_nulls(vec) )
> 
> or something. I'm open to naming ideas 

Something like that could be useful.

> 
> > What is stopping pointer container classes from being used with opaque 
types 
> > as a compilation firewall?
> 
> Can you be more specific? I have some trouble knowing the precise problem.
(Continue reading)


Gmane