Boost logo

Boost Users :

From: me22 (me22.ca_at_[hidden])
Date: 2006-11-18 13:21:52


On 11/17/06, Thorsten Ottosen <thorsten.ottosen_at_[hidden]> wrote:
> > typedef vector<int> VI;
> > VI v(10);
> > int data[] = {0,1,2,3,4,5,6,7,8,9};
> > copy(data,data+10,v.begin());///inserted a few int to std::vector<int>
>
> Hm... this is not legal.
>
Sorry, why?

The constructor makes the size 10, so isn't there space to copy in the
10 elements?

~ SWMc


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