From 53d079271296fa38980de5a6d54b513ead75f594 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Mon, 21 Nov 2016 11:30:09 +0100
Subject: [PATCH] stoi was introduced in C++11. replace with stringstream

---
 ParsingDriver.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ParsingDriver.cc b/ParsingDriver.cc
index 9c5c0409..4b5e5fa4 100644
--- a/ParsingDriver.cc
+++ b/ParsingDriver.cc
@@ -2389,7 +2389,10 @@ ParsingDriver::add_expectation(string *arg1, expr_t arg2)
 expr_t
 ParsingDriver::add_var_expectation(string *arg1, string *arg2, string *arg3)
 {
-  expr_t varExpectationNode = data_tree->AddVarExpectation(mod_file->symbol_table.getID(*arg1), stoi(*arg2), *arg3);
+  stringstream ss(*arg2);
+  int forecast_horizon;
+  ss >> forecast_horizon;
+  expr_t varExpectationNode = data_tree->AddVarExpectation(mod_file->symbol_table.getID(*arg1), forecast_horizon, *arg3);
   delete arg2;
   return varExpectationNode;
 }
-- 
GitLab