Added init forgotten init of FiniteFunction

This commit is contained in:
2018-04-26 03:56:48 +03:00
parent 50d54bd541
commit 3ef983ed17

View File

@@ -14,6 +14,8 @@ class FiniteFunction {
// инициализатор
template <class Callable>
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) )