|
Boost : |
Subject: Re: [boost] Heterogeneous Container Library (HCL) Feedback and Testing
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2015-06-09 04:18:12
On Mon, Jun 8, 2015 at 6:12 PM, James Armstrong <armstrhu_at_[hidden]> wrote:
> Hey guys,
>
> Thanks for the feedback and questions...
>
>
> 1. did you consider providing the same containers without asking for types?
> > In most of my usage of such containers I don't know which types
> > will get in in the end because the container is shared between
> different
> > "modules" all inserting data inside.
> > maybe a heterovector<> type that would take anything would be useful to
> > others too?
> >
>
> This was the original concept. There is the adapter class which allows
> access to any container of type_erased datatypes such as boost::any or
> boost::variant. With this option, one does not need explicitly declare all
> types that can be stored.
>
>
I'm not sure my understanding is correct, are suggesting to do something
like:
heterovector<any> ?
It would defeat the whole point of the container's characteristics.
> 2. did you consider other kinds of non-standard containers?
> > I think in the discussion you linked I posted examples of
> heterogeneous
> > containers I use in production
> > that do not have equivalents in std. From memory:
> > a container of 1 value or none for each type, not more, the type(id)
> > being the key to access the value.
> >
>
> With the adaptor class, any non-standard container can be used. The other
> classes are more or less created for individually for each container type.
> There may be a clever way over completely generalize this, but I haven't
> thought of a way yet.
>
>
>
Sorry I have trouble understanding what you mean here.
If you are suggesting using adapter class over heterosomething,
it would be ok if there was some kind of associative container,
which would then be able to contain <type_index, SomeType>,
to allow me to make an adaptor class tha twould match the container I
described.
Or maybe I just don't understand your answer.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk