From 3ef983ed176671e67a01c56bd00973dc1ecc0cd1 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Thu, 26 Apr 2018 03:56:48 +0300 Subject: [PATCH] Added init forgotten init of FiniteFunction --- finite_function.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/finite_function.hpp b/finite_function.hpp index d78d1c0..1fe2871 100644 --- a/finite_function.hpp +++ b/finite_function.hpp @@ -14,6 +14,8 @@ class FiniteFunction { // инициализатор template FiniteFunction(Callable initer) : _num(0) { + for (auto && el: _results) + el = 0; for (CellType first = 0; first < BASE; ++first) for (CellType second = 0; second < BASE; ++second) { auto inited_result = initer(first, second); @@ -23,6 +25,8 @@ class FiniteFunction { } explicit FiniteFunction(std::string text_repr) { + for (auto && el: _results) + el = 0; size_t cur_ind = 0; for (auto ch: text_repr) { if ( !isdigit(ch) )