diff --git a/include/cppkafka/buffer.h b/include/cppkafka/buffer.h index b4c05cf..1c5e7c9 100644 --- a/include/cppkafka/buffer.h +++ b/include/cppkafka/buffer.h @@ -92,6 +92,10 @@ public: static_assert(sizeof(T) == sizeof(DataType), "sizeof(T) != sizeof(DataType)"); } + // Don't allow construction from temporary vectors + template + Buffer(std::vector&& data) = delete; + /** * Constructs a buffer from an array * @@ -103,9 +107,9 @@ public: static_assert(sizeof(T) == sizeof(DataType), "sizeof(T) != sizeof(DataType)"); } - // Don't allow construction from temporary vectors - template - Buffer(std::vector&& data) = delete; + // Don't allow construction from temporary arrays + template + Buffer(std::array&& data) = delete; /** * \brief Construct a buffer from a const string ref