Template Function util::drain_deque

Function Documentation

template<typename T>
std::vector<T> util::drain_deque(std::deque<T> &queue, size_t n)

Helper function to pop multiple bytes from deque

Note

Assumes there are enough values in the queue to pop, so length checks must be done ahead of time

Return

vector of values from queue

Template Parameters
  • T: is type of items in queue, the first n of which will be returned

Parameters
  • queue: queue of items to pop items from

  • n: number of items to pop from queue