Re: [boost] poly_collection (was sentinels vs iterators)
Ion Gazta?aga
El 23/08/2014 20:53, Joaquin M Lopez Munoz escribi?:
A container that is not a sequence, unordered but not associative. unordered_collection might be an alternative name.
Oy vey.
This name misses the critical feature that elements are polymorphic.
Why use collection rather than container? poly_container.
An interesting addition to Boost.Container?
If I had the time :-/ I' ve been considering working a little more on this to turn the initial sketch into something resembling a full-fledged container, but it'd take me some days' work I don't have.
I couldn't sleep for a while last night and my thoughts turned to this subject. I had thought this was an interesting (birds of a feather) idea and then realized it would also be helpful from a serialization perspective. Rather than having to marshal a type identifier before each instance, you could (iiuc) marshal a type identifier and how many instances will follow. Something like Derived_1_type_id 50 Derived_2_type_id 77 So it would reduce the serialization overhead compared to other containers. I think it's a good idea and look forward to seeing it developed further. -- Brian Ebenezer Enterprises - In G-d we trust. http://webEbenezer.net
Brian Wood
El 23/08/2014 20:53, Joaquin M Lopez Munoz escribi?:
This name misses the critical feature that elements are polymorphic.
Why use collection rather than container? poly_container.
To my mind, "collection" implies some sort of unorderedness, so the term seems more specific than plain "container". Another possibility would be "bag", although that sounds to me, well, too baggy.
I couldn't sleep for a while last night and my thoughts turned to this subject. I had thought this was an interesting (birds of a feather) idea and then realized it would also be helpful from a serialization perspective. Rather than having to marshal a type identifier before each instance, you could (iiuc) marshal a type identifier and how many instances will follow. [...] So it would reduce the serialization overhead compared to other containers.
I don't know enough about Boost.Serialization to confirm/deny whether the lib provides this sort of optimizations. Having a look at the stuff produced by serializing a vector might give some clues.
I think it's a good idea and look forward to seeing it developed further.
I'll definitely try to spare some time during this year to crank up something. Joaquín M López Muñoz Telefónica
participants (2)
-
Brian Wood
-
Joaquin M Lopez Munoz