From a68acf5c66634444986d2eb5bf96a532c83729d1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Mar 2014 12:09:17 +0100 Subject: [PATCH] util/ConstBuffer: add FromVoid(), ToVoid() to "void" specialization Provide the full API. --- src/util/ConstBuffer.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/ConstBuffer.hxx b/src/util/ConstBuffer.hxx index 6754cb065..2670489b1 100644 --- a/src/util/ConstBuffer.hxx +++ b/src/util/ConstBuffer.hxx @@ -63,6 +63,14 @@ struct ConstBuffer { return ConstBuffer(nullptr, 0); } + constexpr static ConstBuffer FromVoid(ConstBuffer other) { + return other; + } + + constexpr ConstBuffer ToVoid() const { + return *this; + } + constexpr bool IsNull() const { return data == nullptr; }