diff --git a/algorithms_cpp/test/count_test.cc b/algorithms_cpp/test/count_test.cc index 4efd422..e04d15d 100644 --- a/algorithms_cpp/test/count_test.cc +++ b/algorithms_cpp/test/count_test.cc @@ -32,7 +32,7 @@ #include struct IsEven{ - bool operator()(int val) { + bool operator()(int val) const { if (val % 2 == 0) return true; else diff --git a/algorithms_cpp/test/for_each_test.cc b/algorithms_cpp/test/for_each_test.cc index 95e8ae8..a8c58ae 100644 --- a/algorithms_cpp/test/for_each_test.cc +++ b/algorithms_cpp/test/for_each_test.cc @@ -38,7 +38,7 @@ */ struct Square { template - void operator()(Type& l) { + void operator()(Type& l) const { l = l * l; } }; diff --git a/algorithms_cpp/test/reduce_test.cc b/algorithms_cpp/test/reduce_test.cc index d4c48a8..6922594 100644 --- a/algorithms_cpp/test/reduce_test.cc +++ b/algorithms_cpp/test/reduce_test.cc @@ -36,7 +36,7 @@ */ struct Square { template - Type operator()(Type& l) { + Type operator()(Type& l) const { return l * l; } }; diff --git a/algorithms_cpp/test/scan_test.cc b/algorithms_cpp/test/scan_test.cc index 47988df..3597dda 100644 --- a/algorithms_cpp/test/scan_test.cc +++ b/algorithms_cpp/test/scan_test.cc @@ -35,7 +35,7 @@ */ struct Square { template - Type operator()(Type& l) { + Type operator()(Type& l) const { return l * l; } };