Commit 15110fad by Marcus Winter

algorithms_cpp: removed cppcheck style warnings

parent 9c3629c3
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <functional> #include <functional>
struct IsEven{ struct IsEven{
bool operator()(int val) { bool operator()(int val) const {
if (val % 2 == 0) if (val % 2 == 0)
return true; return true;
else else
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
*/ */
struct Square { struct Square {
template<typename Type> template<typename Type>
void operator()(Type& l) { void operator()(Type& l) const {
l = l * l; l = l * l;
} }
}; };
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
*/ */
struct Square { struct Square {
template<typename Type> template<typename Type>
Type operator()(Type& l) { Type operator()(Type& l) const {
return l * l; return l * l;
} }
}; };
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
*/ */
struct Square { struct Square {
template<typename Type> template<typename Type>
Type operator()(Type& l) { Type operator()(Type& l) const {
return l * l; return l * l;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment