Boost logo

Boost :

Subject: Re: [boost] Heterogeneous Container Library (HCL) Feedback and Testing
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2015-06-03 11:24:33


2015-06-02 23:41 GMT+02:00 James Armstrong <armstrhu_at_[hidden]>:

> I send out a little feeler about a month ago for interest in a container
> library which natively allows users to insert a heterogeneous set of
> types. After getting some really good feedback, I think I have settled
> into something that is efficient, has a nice clean interface, and provides
> some useful capabilities. I am hoping people can take a look at the code,
> test it out, and provide an additional feedback in terms of interface,
> implementation, bugs, or additional features/classes that would be useful.
>
> I have implemented a set of containers which mimic the capabilities of the
> STL containers. These are (so far)
>
> * heterovector
> * heterostack
> * heteroqueue
> * heterolist
> * heteroforward_list
> * heterodeque
>
> These containers were implemented using variadic templates and were
> somewhat inspired from the posts of Joaquín Muñoz.
>
> http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections.html
> http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections-with.html
>
> In addition, I have an adaptor class which provides a simple interface for
> accessing data of a specific type from a container of type_erased objects
> (boost::any, boost::variant, etc).
>
> The code is hosted at
>
> https://github.com/armstrhu/HCL
>
> and the directory structure there should be simple to navigate. There is
> an include directory which contains the header files needed, and an
> examples directory which provides examples for using the containers and the
> adaptors. As they mimic the STL containers, once you see how to use them
> (basically just provide an additional template parameter) you should be
> able to use them smoothly.
>
> One note is I focused mainly on developing the heterovector class, and the
> remainders are primarily copies of that class where std::vector has been
> replaced with std::deque, std::list, etc, and associated methods
> added/removed as needed. I have primarily tested with the heterovector, so
> having people check out the other classes would be nice :)
>
> Any and all feedback is much appreciated. Thanks!

Hi James,
I think I missed your previous announcement, so pardon me if I am asking
something you have already explained. What is the typical use case you are
trying to address, fromthe example on GitHub, I gather that:

heterogeneous::heterovector<int, double, std::string, double> hv;

Is an alternative to:

struct vectors
{
    std::vector<int> ints;
    std::vector<double> doubles;
    std::vector<std::string> strings;
    std::vector<double> doubles1;
} hv;

Does it offer any advantages over the latter? Could you compare them,
so that I know what I ain by switching to your library?

Regards,

&rzej


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk