From d08da36dfed77fabaecbf987ca9cb783ee5d22be Mon Sep 17 00:00:00 2001
From: Tammo Jan Dijkema <dijkema@astron.nl>
Date: Fri, 8 Jan 2016 14:05:03 +0000
Subject: [PATCH] Task #8973: fix c++11 compilation errors with pybdsm

---
 CEP/PyBDSM/src/c++/MGFunction1.cc | 10 +++++-----
 CEP/PyBDSM/src/c++/MGFunction2.cc |  8 ++++----
 CEP/PyBDSM/src/c++/stat.cc        |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/CEP/PyBDSM/src/c++/MGFunction1.cc b/CEP/PyBDSM/src/c++/MGFunction1.cc
index bdfab91b1e8..9aacf8e516e 100644
--- a/CEP/PyBDSM/src/c++/MGFunction1.cc
+++ b/CEP/PyBDSM/src/c++/MGFunction1.cc
@@ -106,7 +106,7 @@ void MGFunction::py_remove_gaussian(int idx)
 //
 // Get gaussian parameters by index
 //
-tuple MGFunction::py_get_gaussian(int idx)
+boost::python::tuple MGFunction::py_get_gaussian(int idx)
 {
   if (idx < 0)
     idx += m_gaul.size();
@@ -116,7 +116,7 @@ tuple MGFunction::py_get_gaussian(int idx)
 
   vector<double> &p = m_parameters[idx];
 
-  return make_tuple(p[0], p[1], p[2], p[3], p[4], p[5]);
+  return boost::python::make_tuple(p[0], p[1], p[2], p[3], p[4], p[5]);
 }
 
 //
@@ -171,7 +171,7 @@ list MGFunction::py_get_errors()
 
   for (unsigned i = 0; i < m_gaul.size(); ++i) {
     vector<double> &e = m_errors[i];
-    res.append(make_tuple(e[0], e[1], e[2], e[3], e[4], e[5]));
+    res.append(boost::python::make_tuple(e[0], e[1], e[2], e[3], e[4], e[5]));
   }
 
   return res;
@@ -180,7 +180,7 @@ list MGFunction::py_get_errors()
 //
 // Find highest peak in the data-MGFunction residual
 //
-tuple MGFunction::py_find_peak()
+boost::python::tuple MGFunction::py_find_peak()
 {
   vector<double> buf(data_size());
   fcn_diff(&buf.front());
@@ -197,7 +197,7 @@ tuple MGFunction::py_find_peak()
   int x1 = mm_data[pidx].x1;
   int x2 = mm_data[pidx].x2;
 
-  return make_tuple(peak, make_tuple(x1, x2));
+  return boost::python::make_tuple(peak, boost::python::make_tuple(x1, x2));
 }
 
 
diff --git a/CEP/PyBDSM/src/c++/MGFunction2.cc b/CEP/PyBDSM/src/c++/MGFunction2.cc
index aff1746c201..3f6e139b74d 100644
--- a/CEP/PyBDSM/src/c++/MGFunction2.cc
+++ b/CEP/PyBDSM/src/c++/MGFunction2.cc
@@ -62,7 +62,7 @@ void MGFunction::get_parameters(double *buf) const
 {
   double *chk = buf;
   for (unsigned i = 0; i < m_gaul.size(); ++i) {
-    copy_n(m_parameters[i].begin(), m_gaul[i], buf);
+    std::copy_n(m_parameters[i].begin(), m_gaul[i], buf);
     buf += m_gaul[i];
   }
   assert(buf - chk == (int)m_npar);
@@ -76,7 +76,7 @@ void MGFunction::set_parameters(const double *buf)
 {
   const double *chk = buf;
   for(unsigned i = 0; i < m_gaul.size(); ++i) {
-    copy_n(buf, m_gaul[i], m_parameters[i].begin());
+    std::copy_n(buf, m_gaul[i], m_parameters[i].begin());
     buf += m_gaul[i];
   }
   assert(buf - chk == (int)m_npar);
@@ -90,7 +90,7 @@ void MGFunction::get_nlin_parameters(double *buf) const
 {
   double *chk = buf;
   for (unsigned i = 0; i < m_gaul.size(); ++i) {
-    copy_n(m_parameters[i].begin() + 1, m_gaul[i] - 1, buf);
+    std::copy_n(m_parameters[i].begin() + 1, m_gaul[i] - 1, buf);
     buf += m_gaul[i] - 1;
   }
   assert(buf - chk == (int)(m_npar - m_gaul.size()));
@@ -104,7 +104,7 @@ void MGFunction::set_nlin_parameters(const double *buf)
 {
   const double *chk = buf;
   for(unsigned i = 0; i < m_gaul.size(); ++i) {
-    copy_n(buf, m_gaul[i] - 1, m_parameters[i].begin() + 1);
+    std::copy_n(buf, m_gaul[i] - 1, m_parameters[i].begin() + 1);
     buf += m_gaul[i] - 1 ;
   }
   assert(buf - chk == (int)(m_npar - m_gaul.size()));
diff --git a/CEP/PyBDSM/src/c++/stat.cc b/CEP/PyBDSM/src/c++/stat.cc
index 15ef128032e..1220a250ed9 100644
--- a/CEP/PyBDSM/src/c++/stat.cc
+++ b/CEP/PyBDSM/src/c++/stat.cc
@@ -229,7 +229,7 @@ static object _bstat(numeric::array arr, object mask, double kappa)
  /* py_assert(res.second == dev.back(),
 	    PyExc_RuntimeError, "clipped rRMS calculation does not converge"); */
 
-  return make_tuple(mean[1], dev[1], mean.back(), dev.back(), cnt);
+  return boost::python::make_tuple(mean[1], dev[1], mean.back(), dev.back(), cnt);
 }
 
 object bstat(numeric::array arr, object mask, double kappa)
@@ -264,5 +264,5 @@ object bstat(numeric::array arr, object mask, double kappa)
  fail:
   py_assert(false, 
 	    PyExc_RuntimeError, "bstat dispatch failed: not implemented for this datatype/layout");
-  return tuple(); // this is fake return-statement to silence the compiler
+  return boost::python::tuple(); // this is fake return-statement to silence the compiler
 }
-- 
GitLab