From af3b454805b49301b14f2f55f7a99020527bd63a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Dec 2013 09:20:46 +0100 Subject: [PATCH] pcm/PcmBuffer: add typed method GetT() --- src/pcm/PcmBuffer.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pcm/PcmBuffer.hxx b/src/pcm/PcmBuffer.hxx index 717e24938..44a3ebf99 100644 --- a/src/pcm/PcmBuffer.hxx +++ b/src/pcm/PcmBuffer.hxx @@ -49,6 +49,12 @@ public: */ gcc_malloc void *Get(size_t size); + + template + gcc_malloc + T *GetT(size_t n) { + return (T *)Get(n * sizeof(T)); + } }; #endif