- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i have in my program a list of vectors, the vectors contain integer. I create this list via the 'new' keyword. To fill this list in parallel, i changed the list to a cilk::reducer_list_append. So far so good, everything works fine.
My question is: How do i properly delete this reducer-list? If it was a 'normal' two dimensional list, i would loop through the list, delete everything vector or just pop_back() until the list is empty and then delete the list itself. But i can't do that with a reducer, can i? Is there a way to access e.g. the first element to delete it or is there something similar to the pop_back() oder pop_front()-function? Or is it enough to 'just delete' the list?
[cpp]
#include <cilk/reducer_list.h>
#include <vector>
int main() {
cilk::reducer_list_append< vector< int > > * mylist = new cilk::reducer_list_append< vector< int > ;
vector < int > myvector (4,1);
mylist.push_back(myvector);
mylist.push_back(myvector);
delete(mylist) //What exactly happens here?
}
[/cpp]
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page