rvalue problem again!! Grrrrr...

release/4.3a0
Duy-Nguyen Ta 2016-06-16 08:10:46 -04:00
parent 8cdddeccd1
commit dbac6169b2
1 changed files with 2 additions and 2 deletions

View File

@ -99,8 +99,8 @@ protected:
*/ */
template <class PROBLEM> template <class PROBLEM>
Key maxKey(const PROBLEM& problem) { Key maxKey(const PROBLEM& problem) {
Key maxKey = auto keys = problem.cost.keys();
*std::max_element(problem.cost.keys().begin(), problem.cost.keys().end()); Key maxKey = *std::max_element(keys.begin(), keys.end());
if (!problem.equalities.empty()) if (!problem.equalities.empty())
maxKey = std::max(maxKey, *problem.equalities.keys().rbegin()); maxKey = std::max(maxKey, *problem.equalities.keys().rbegin());
if (!problem.inequalities.empty()) if (!problem.inequalities.empty())