|
Boost Users : |
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2007-08-21 14:02:40
The better way to do this, would be once to initialize the map of const
vectors. I think this will give the compiler enough info not to grow vectors
and reserve a lot of space. Both vector and any will reserve/allocate heap
space, which is less efficient compared to array.
On 8/21/07, Darren Garvey <lists.drrngrvy_at_[hidden]> wrote:
>
>
>
> On 21/08/07, Panayiotis <panayk_at_[hidden]> wrote:
> >
> > --- snip ---
> > The problem is that:
> > a) I don't know the size at compile time.
> > b) Once initialized, the array's size stays constant, so vector would be
> > overkill.
>
>
> There's probably a better way to do this that I don't know about, but one
> fall-back could be boost::any ( http://boost.org/libs/any).
>
> hth,
> Darren
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net