Order of evaluation of operands in C++ is unspecified.

This commit is contained in:
Pedro Pinto committed 2017-10-12 16:35:48 +00:00
1 parent b5f1c9d93b
commit d51d76d055
1 file changed
+5 -2
+5 -2
View File
@@ -52,8 +52,11 @@ std::pair<Security const*,Security const*> get_front_month_es_futures ()
}
bts_assert(es_futures.size() >= 2);
auto exp_it = es_futures.begin();
result = std::make_pair(exp_it->second,(++exp_it)->second);
auto it = es_futures.begin();
auto sec1 = it->second;
it++;
auto sec2 = it->second;
result = std::make_pair(sec1,sec2);
return result;
}