Boost logo

Boost Users :

Subject: Re: [Boost-users] Do not understand about creating a vector of vector using Boost::interprocess libraries
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2014-08-16 13:49:12


El 15/08/2014 14:49, 张国熙 escribió:
> Dear everyone,
>
> I've just begun learning to use IPC in boost. Here I want to create a
> vector of vector<std::complex<double>>, that is to say, a matrix of complex.

> m->resize(4);

A shared memory vector is not default constructible so you can't resize
it without giving an argument.

    m->reserve(4);
    m->resize(4, (*m)[0]);

should work.

Best,

Ion


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