From fe57f3f5c522de23233595cd1413799b0ecbc113 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 22 Mar 2014 10:10:31 +0400 Subject: [PATCH] Array<>::resize() pass-by-value fix --- libuavcan/include/uavcan/marshal/array.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libuavcan/include/uavcan/marshal/array.hpp b/libuavcan/include/uavcan/marshal/array.hpp index 1d7669fcf3..dd72754570 100644 --- a/libuavcan/include/uavcan/marshal/array.hpp +++ b/libuavcan/include/uavcan/marshal/array.hpp @@ -341,7 +341,7 @@ public: Base::at(size() - 1) = value; } - void resize(SizeType new_size, ValueType filler = ValueType()) + void resize(SizeType new_size, const ValueType& filler) { if (new_size > size()) { @@ -357,6 +357,11 @@ public: } } + void resize(SizeType new_size) + { + resize(new_size, ValueType()); + } + /* * Comparison operators */