Skip to content

Commit

Permalink
Deprecate getAndRemoveFromVector in PointerVector
Browse files Browse the repository at this point in the history
- Included "DeprecationUtils.h" in PointerVector.h for deprecation support.
- Added deprecation notice to getAndRemoveFromVector within the pcpp namespace, advising the use of getAndDetach for memory safety.
  • Loading branch information
Dimi1010 committed Jun 30, 2024
1 parent d8a3dd7 commit 03b2593
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Common++/header/PointerVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <vector>
#include <memory>

#include "DeprecationUtils.h"

/// @file

/**
Expand Down Expand Up @@ -249,7 +251,9 @@ namespace pcpp
* The iterator is shifted to the following element after the removal is completed.
* @return A pointer to the element which is no longer managed by the vector. It's user responsibility to free
* it
* @deprecated Deprecated in favor of 'getAndDetach' as that function provides memory safety.
*/
PCPP_DEPRECATED("Please use the memory safe 'getAndDetach' instead.")
T* getAndRemoveFromVector(VectorIterator& position)
{
T* result = *position;
Expand Down

0 comments on commit 03b2593

Please sign in to comment.