diff options
author | Sven Gothel <[email protected]> | 2022-12-30 13:07:41 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-12-30 13:07:41 +0100 |
commit | 59805e4c79d84b2918743d436b0d870204d1151b (patch) | |
tree | cb4618075d4d2ffced48f83a8d6dcac8b5cdd595 /test/test_functional_perf.hpp | |
parent | 653158011aa441e7676397caf8c5eb998202f101 (diff) |
C++20: Avoid using add-assign on volatile lvalue (deprecated in C++20), use explicit add.
Note: Volatile is used here merely to avoid compiler optimizations.
Diffstat (limited to 'test/test_functional_perf.hpp')
-rw-r--r-- | test/test_functional_perf.hpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/test_functional_perf.hpp b/test/test_functional_perf.hpp index e3a1ce1..fe33d15 100644 --- a/test/test_functional_perf.hpp +++ b/test/test_functional_perf.hpp @@ -215,7 +215,7 @@ class TestFunction01 { BENCHMARK("free_rawfunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += TestFunction01::Func03a_static(i); + r = r + TestFunction01::Func03a_static(i); } return r; }; @@ -228,7 +228,7 @@ class TestFunction01 { BENCHMARK("free_cfuncptr") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -241,7 +241,7 @@ class TestFunction01 { BENCHMARK("free_stdfunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -254,7 +254,7 @@ class TestFunction01 { BENCHMARK("free_jaufunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -265,7 +265,7 @@ class TestFunction01 { BENCHMARK("member_rawfunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += func02a_member(i); + r = r + func02a_member(i); } return r; }; @@ -279,7 +279,7 @@ class TestFunction01 { BENCHMARK("member_stdbind_unspec") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -292,7 +292,7 @@ class TestFunction01 { BENCHMARK("member_jaufunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -311,7 +311,7 @@ class TestFunction01 { BENCHMARK("capval_small_jaufunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -350,7 +350,7 @@ class TestFunction01 { BENCHMARK("capval_big_jaufunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -369,7 +369,7 @@ class TestFunction01 { BENCHMARK("capref_jaufunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -385,7 +385,7 @@ class TestFunction01 { BENCHMARK("lambda_plain_std_function") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -400,7 +400,7 @@ class TestFunction01 { BENCHMARK("lambda_plain_jaufunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -417,7 +417,7 @@ class TestFunction01 { BENCHMARK("lambda_capt_std_function") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -434,7 +434,7 @@ class TestFunction01 { BENCHMARK("lambda_capt_jaufunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; @@ -449,7 +449,7 @@ class TestFunction01 { BENCHMARK("ylambda_none_jaufunc") { volatile int r=0; for(int i=0; i<loops; ++i) { - r += f(i); + r = r + f(i); } return r; }; |