[openrtm-commit:01216] r2411 - trunk/OpenRTM-aist/examples/ConfigSample

openrtm @ openrtm.org openrtm @ openrtm.org
2014年 2月 6日 (木) 12:18:43 JST


Author: n-ando
Date: 2014-02-06 12:18:43 +0900 (Thu, 06 Feb 2014)
New Revision: 2411

Modified:
   trunk/OpenRTM-aist/examples/ConfigSample/VectorConvert.h
Log:
[compat,->RELENG_1_1] For Mac OS X, operator>>() should not be in global scope, moved to std.

Modified: trunk/OpenRTM-aist/examples/ConfigSample/VectorConvert.h
===================================================================
--- trunk/OpenRTM-aist/examples/ConfigSample/VectorConvert.h	2014-02-06 03:13:50 UTC (rev 2410)
+++ trunk/OpenRTM-aist/examples/ConfigSample/VectorConvert.h	2014-02-06 03:18:43 UTC (rev 2411)
@@ -1,26 +1,30 @@
-// -*- C++ -*-
-
-#include <istream>
-#include <ostream>
-#include <vector>
-#include <string>
-#include <coil/stringutil.h>
-
-template<typename T>
-std::istream& operator>>(std::istream& is, std::vector<T>& v)
-{
-  std::string s;
-  std::vector<std::string> sv;
-  is >> s;
-  sv = coil::split(s ,",");
-  v.resize(sv.size());
-  for (int i(0), len(sv.size()); i < len; ++i)
-    {
-      T tv;
-      if (coil::stringTo(tv, sv[i].c_str()))
-	{
-	  v[i] = tv;
-	}
-    }
-  return is;
-}
+// -*- C++ -*-
+
+#include <istream>
+#include <ostream>
+#include <vector>
+#include <string>
+#include <coil/stringutil.h>
+
+namespace std
+{
+  template<typename T>
+  std::istream& operator>>(std::istream& is, std::vector<T>& v)
+  {
+    std::string s;
+    std::vector<std::string> sv;
+    is >> s;
+    sv = coil::split(s ,",");
+    v.resize(sv.size());
+    for (int i(0), len(sv.size()); i < len; ++i)
+      {
+	T tv;
+	if (coil::stringTo(tv, sv[i].c_str()))
+	  {
+	    v[i] = tv;
+	  }
+      }
+    return is;
+  }
+}
+



More information about the openrtm-commit mailing list