From 31c08fba766b489a03ed25696b5f0a126056a5a6 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Fri, 13 Dec 2019 19:07:17 +0300 Subject: [PATCH] Using constexpt for getting initial functions --- main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 5e270c9..699341a 100644 --- a/main.cpp +++ b/main.cpp @@ -127,18 +127,18 @@ vector get_function_class(MyFunction f, const vector< MyMatrix >& tr vector get_linear_components() { vector res; - if ( ARGS_COUNT == 3 ) { + if constexpr ( ARGS_COUNT == 3 ) { res.push_back(MyFunction("11111111")); // f = 1 res.push_back(MyFunction("00001111")); // f = x_1 res.push_back(MyFunction("00110011")); // f = x_2 res.push_back(MyFunction("01010101")); // f = x_3 - } else if ( ARGS_COUNT == 4 ) { + } else if constexpr ( ARGS_COUNT == 4 ) { res.push_back(MyFunction("1111111111111111")); // f = 1 res.push_back(MyFunction("0000000011111111")); // f = x_1 res.push_back(MyFunction("0000111100001111")); // f = x_2 res.push_back(MyFunction("0011001100110011")); // f = x_3 res.push_back(MyFunction("0101010101010101")); // f = x_4 - } else if ( ARGS_COUNT == 5 ) { + } else if constexpr ( ARGS_COUNT == 5 ) { res.push_back(MyFunction("11111111111111111111111111111111")); // f = 1 res.push_back(MyFunction("00000000000000001111111111111111")); // f = x_1 res.push_back(MyFunction("00000000111111110000000011111111")); // f = x_2