Code

Replace std::tr1::unordered_(map|set) with __gnu_cxx::hash_(map|set),
[inkscape.git] / src / ui / tool / multi-path-manipulator.cpp
index 3ae7e4d2495264cb8c3f4a32fc870d4d4c7faa6b..818bdaedcf4c35940c18c6e033e3f29ada4389b6 100644 (file)
@@ -8,7 +8,8 @@
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
-#include <tr1/unordered_set>
+//#include <tr1/unordered_set>
+#include <ext/hash_set>
 #include <boost/shared_ptr.hpp>
 #include <glib.h>
 #include <glibmm/i18n.h>
 #include "ui/tool/multi-path-manipulator.h"
 #include "ui/tool/path-manipulator.h"
 
-namespace std { using namespace tr1; }
+namespace std { using namespace __gnu_cxx; }
+
+namespace __gnu_cxx {
+template<>
+struct hash<Inkscape::UI::NodeList::iterator> {
+    size_t operator()(Inkscape::UI::NodeList::iterator const &n) const {
+        return reinterpret_cast<size_t>(n.ptr());
+    }
+};
+}
 
 namespace Inkscape {
 namespace UI {
@@ -33,7 +43,7 @@ namespace UI {
 namespace {
 typedef std::pair<NodeList::iterator, NodeList::iterator> IterPair;
 typedef std::vector<IterPair> IterPairList;
-typedef std::unordered_set<NodeList::iterator> IterSet;
+typedef std::hash_set<NodeList::iterator> IterSet;
 typedef std::multimap<double, IterPair> DistanceMap;
 typedef std::pair<double, IterPair> DistanceMapItem;