From 211aea1441bcb7cf79f2b143fbed9d8f641c13ef Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 26 Jun 2014 13:29:51 +0200 Subject: [PATCH] util/ConstBuffer: add method skip_front() --- src/util/ConstBuffer.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/util/ConstBuffer.hxx b/src/util/ConstBuffer.hxx index 1ba4301c8..4d0a49e98 100644 --- a/src/util/ConstBuffer.hxx +++ b/src/util/ConstBuffer.hxx @@ -237,6 +237,15 @@ struct ConstBuffer { pop_front(); return result; } + + void skip_front(size_type n) { +#ifndef NDEBUG + assert(size >= n); +#endif + + data += n; + size -= n; + } }; #endif