|
Boost Users : |
From: Panayiotis (panayk_at_[hidden])
Date: 2007-08-21 12:05:18
Ovanes Markarian wrote:
> There is no equivalent, since boost::array must be parametrisized with
> the size. So boost::array<std::string, 10> has different type as
> boost::array<std::string, 11>.
>
> You might be able to use:
>
> template<int ArraySize_>
> void foo(boost::array<int, ArraySize_> const&);
>
> But this depeneds if you know the size of your array at compile time.
>
> Using std::vector<int> might be of more value ;)
>
> Best Regards,
> Ovanes
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.
Actually what I really want to do is:
map<int, int[]>
in an elegant and safe way.
Oh well, I'll have to go with map<int, void*> or make a struct to hold
the size of a c array.
Thanks for the answer,
Panayiotis
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