From 2ef759877eb009961ffdd84893b275a17d7dfc86 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 11 Apr 2018 18:23:57 +1000 Subject: [PATCH] matrix: add scalar filling constructor --- matrix.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/matrix.hpp b/matrix.hpp index a4f25e7d..43668483 100644 --- a/matrix.hpp +++ b/matrix.hpp @@ -48,6 +48,12 @@ namespace util { /////////////////////////////////////////////////////////////////////// constexpr matrix () noexcept = default; + constexpr matrix(ValueT fill) + { + for (auto &r: values) + r = fill; + } + //--------------------------------------------------------------------- constexpr matrix (const ValueT(&_data)[Rows][Cols]) noexcept: