Commit 15110fad by Marcus Winter

algorithms_cpp: removed cppcheck style warnings

parent 9c3629c3
......@@ -32,7 +32,7 @@
#include <functional>
struct IsEven{
bool operator()(int val) {
bool operator()(int val) const {
if (val % 2 == 0)
return true;
else
......
......@@ -38,7 +38,7 @@
*/
struct Square {
template<typename Type>
void operator()(Type& l) {
void operator()(Type& l) const {
l = l * l;
}
};
......
......@@ -36,7 +36,7 @@
*/
struct Square {
template<typename Type>
Type operator()(Type& l) {
Type operator()(Type& l) const {
return l * l;
}
};
......
......@@ -35,7 +35,7 @@
*/
struct Square {
template<typename Type>
Type operator()(Type& l) {
Type operator()(Type& l) const {
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