Skip to content

Commit 11fad81

Browse files
committed
added volatile, blocks nrvo.
1 parent 999ea24 commit 11fad81

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

RTLBenchmarkApp/src/BenchMark.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ namespace rtl_bench
6262
void BenchMark::stdFunctionCall_withReturn(benchmark::State& state)
6363
{
6464
static std::function getMsg = [](argStr_t& pMsg) {
65-
return getMessage(pMsg);
65+
retStr_t retMsg = getMessage(pMsg);
66+
volatile auto *msg = &retMsg;
67+
return retMsg;
6668
};
6769

6870
for (auto _ : state)

0 commit comments

Comments
 (0)