From 4306a94379847613505517337634495bb8cf4037 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 6 Mar 2017 21:36:04 +1100 Subject: [PATCH] matrix: add assignment-multiplication operator --- matrix.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/matrix.hpp b/matrix.hpp index 05463b5b..e66cf5a7 100644 --- a/matrix.hpp +++ b/matrix.hpp @@ -143,7 +143,22 @@ namespace util { size_t R1, size_t C1, size_t R2, size_t C2, typename T - > constexpr matrix operator* (const matrix&, const matrix&); + > + constexpr + matrix + operator* (const matrix&, const matrix&); + + + //------------------------------------------------------------------------- + template < + size_t R1, size_t C1, + size_t R2, size_t C2, + typename T + > + constexpr + matrix& + operator*= (matrix &a, const matrix &b) + { return a = a * b; }; ///////////////////////////////////////////////////////////////////////////