Boost logo

Boost :

Subject: Re: [boost] Heterogeneous Container Library (HCL) Feedback and Testing
From: Rob Stewart (rob.stewart_at_[hidden])
Date: 2015-06-13 06:53:42


On June 8, 2015 12:12:12 PM EDT, James Armstrong <armstrhu_at_[hidden]> wrote:
>
> Have you considered to provide access to some kind of containers views
> > that behave like standard containers
>
> Yes, there is a method container() which returns a pointer to the
> underlying container from which you can use any function designed for
> the STL containers.

Why would you return a pointer? Can it be null? If so, under what circumstances?

> Now that you bring this up, having this makes pretty
> much everything else redundant.

Exactly

> I think I will rename this to get<T,N=0> and
> have the interface be as you suggested...much simpler and easier to
> maintain.
>
> hv.get<int,1>().push_back(5);

That won't be as useful for non-numeric keys if you have associative containers.

> for (auto itr = hv.get<double>().begin(); itr !=
> hv.get<double>().end()
> ++itr)
> cout << *itr << "\n";

for (auto d : hv.get<double>())
{
   std::cout << d << '\n';
}

___
Rob

(Sent from my portable computation engine)


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