Functions
gpp_prune_path::internal Namespace Reference

Functions

template<typename _Iter >
_Iter prune (_Iter _begin, _Iter _end, size_t _step)
 inplace pruning for a random-access iterator-sequence More...
 

Function Documentation

◆ prune()

template<typename _Iter >
_Iter gpp_prune_path::internal::prune ( _Iter  _begin,
_Iter  _end,
size_t  _step 
)

inplace pruning for a random-access iterator-sequence

The generated sequence will always contain the first and last pose. Use it in combination with erase, to obtain a pruned sequence.

Below some examples:

// create some data
std::vector<int> d {1, 2, 3, 4, 5};
// prune the data and drop redundant data
// d contains after this {1, 3, 5}
d.erase(prune(d.begin(), d.end(), 2), d.end());
// create another array
std::vector<int> e{1, 2, 3, 4, 5, 6};
// run again the same operation:
// e contains after this {1, 4, 6}
e.erase(prune(e.begin(), e.end(), 3), e.end());
Template Parameters
_Iterrandom access iterator
Parameters
_beginbegin of the sequence
_endend of the sequence
_steppositive integer for skipping
Returns
the end iterator of the pruned sequence

Definition at line 68 of file gpp_prune_path.hpp.

d
d
gpp_prune_path::internal::prune
_Iter prune(_Iter _begin, _Iter _end, size_t _step)
inplace pruning for a random-access iterator-sequence
Definition: gpp_prune_path.hpp:68


gpp_prune_path
Author(s):
autogenerated on Wed Mar 2 2022 00:21:26