File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
ReflectionTemplateLib/detail/inc Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,7 @@ namespace rtl_bench
5454
5555 for (auto _ : state)
5656 {
57- volatile std::string forced = std::move (getMessage (g_longStr)); // ensures real move
58- benchmark::DoNotOptimize (forced);
57+ benchmark::DoNotOptimize (getMessage (g_longStr));
5958 }
6059 }
6160
@@ -68,8 +67,7 @@ namespace rtl_bench
6867
6968 for (auto _ : state)
7069 {
71- volatile std::string forced = std::move (getMsg (g_longStr)); // ensures real move
72- benchmark::DoNotOptimize (forced);
70+ benchmark::DoNotOptimize (getMsg (g_longStr));
7371 }
7472 }
7573}
Original file line number Diff line number Diff line change 1313#endif
1414
1515using argStr_t = std::string_view;
16- using retStr_t = std::string ;
16+ using retStr_t = std::string_view ;
1717
1818namespace rtl_bench
1919{
@@ -24,7 +24,8 @@ namespace rtl_bench
2424 }
2525
2626 NOINLINE static retStr_t getMessage (argStr_t pMsg) {
27- return retStr_t (pMsg);
27+ g_msg = pMsg;
28+ return retStr_t (g_msg->c_str ());
2829 }
2930
3031 struct Node
@@ -35,7 +36,8 @@ namespace rtl_bench
3536
3637 NOINLINE retStr_t getMessage (argStr_t pMsg)
3738 {
38- return retStr_t (pMsg);
39+ g_msg = pMsg;
40+ return retStr_t (g_msg->c_str ());
3941 }
4042 };
4143
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ namespace rtl
6969 }
7070 else {
7171
72- _returnType&& retObj = ( target.*pFunctor)(std::forward<_signature>(params)...);
72+ _returnType&& retObj = std::move (( target.*pFunctor)(std::forward<_signature>(params)...) );
7373 return { error::None,
7474 RObjectBuilder<_returnType>::build<alloc::Stack>(
7575 std::forward<_returnType>(retObj), isConstCastSafe)
@@ -118,7 +118,7 @@ namespace rtl
118118 };
119119 }
120120 else {
121- _returnType&& retObj = ( target.*pFunctor)(std::forward<_signature>(params)...);
121+ _returnType&& retObj = std::move (( target.*pFunctor)(std::forward<_signature>(params)...) );
122122 return { error::None,
123123 RObjectBuilder<_returnType>::build<alloc::Stack>(
124124 std::forward<_returnType>(retObj), isConstCastSafe)
You can’t perform that action at this time.
0 commit comments