Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-09-24 03:38:20


Joel de Guzman wrote:
> Hi,

Hi Joel,

Sorry for the late reply.

>
> What's the preferred way to have a vector with more than 10
> elements? Right now I am using vectorN,

That's the one.

> but these vectors are not extensible (resizable).

They are! For instance, this one works on all supported platforms:

    #include "boost/mpl/vector/vector10.hpp"
    #include "boost/mpl/push_front.hpp"

    using namespace boost::mpl;

    typedef push_front<
          vector5<bool,char,short,int,long>
        , float
>::type t; // OK

... with a caveat that on compilers which don't provide 'typeof' this one

    typedef push_front<
          vector9<bool,char,short,int,long,...>
          ^^^^^^^
        , float
>::type t;

would require an additional include:

    #include "boost/mpl/vector/vector20.hpp"

> I am aware that there are some limits that we can set. My concern is
> that I wish to avoid setting some constants for fear that another
> library might also be using MPL with another set of constants. I'd
> appreciate some clarification in this area.

Does the above helps?

Aleksey


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