From f10abf6e35b0779e27d35bbe02cfbfe9585da511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Mon, 31 Aug 2020 11:11:41 +0300 Subject: [PATCH] reader_permit: reader_resources: add with_memory() factory function To make creating reader resource with just memory more convenient and more readable at the same time. --- reader_permit.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reader_permit.hh b/reader_permit.hh index 8d85d19aa4..9c977acc17 100644 --- a/reader_permit.hh +++ b/reader_permit.hh @@ -31,6 +31,8 @@ struct reader_resources { int count = 0; ssize_t memory = 0; + static reader_resources with_memory(ssize_t memory) { return reader_resources(0, memory); } + reader_resources() = default; reader_resources(int count, ssize_t memory)