Project

General

Profile

Feature #858

Request ability to remove items from a PtrVector

Added by Christopher Green about 9 years ago. Updated about 9 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
01/24/2011
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Scope:
Internal
Experiment:
-
SSI Package:
Duration:

Description

Want to be able to drop items from a PtrVector.

History

#1 Updated by Marc Paterno about 9 years ago

  • Status changed from New to Rejected
  • Assignee set to Marc Paterno
  • % Done changed from 0 to 100
  • Estimated time set to 2.00 h

Removing items from a PtrVector would be both inefficient and dangerous.
1. Inefficient, because elements in the vector after the one removed have to be moved "up"
2. Dangerous, because iterators into the vector would be invalidated by the removal (more importantly, the previously returned end() would be wrong).

Instead, I have created a function (implemented in the header for Ptr) that will fill a std::list<Ptr<T> > from a given Handle<C>, where C::value_type is T.



Also available in: Atom PDF