Browse Source

Removed RKTOutputIterator and switched code to use std::back_inserter as the rocket version was causing issues in VS2010 in release builds.

Lloyd Weehuizen 15 years ago
parent
commit
2a562a4621
2 changed files with 3 additions and 43 deletions
  1. 3 2
      Source/Core/Context.cpp
  2. 0 41
      Source/Core/EventIterators.h

+ 3 - 2
Source/Core/Context.cpp

@@ -27,12 +27,13 @@
 
 #include "precompiled.h"
 #include <Rocket/Core.h>
-#include <algorithm>
 #include "EventDispatcher.h"
 #include "EventIterators.h"
 #include "PluginRegistry.h"
 #include "StreamFile.h"
 #include <Rocket/Core/StreamMemory.h>
+#include <algorithm>
+#include <iterator>
 
 namespace Rocket {
 namespace Core {
@@ -1162,7 +1163,7 @@ void Context::ReleaseUnloadedDocuments()
 void Context::SendEvents(const ElementSet& old_items, const ElementSet& new_items, const String& event, const Dictionary& parameters, bool interruptible)
 {
 	ElementList elements;
-	std::set_difference(old_items.begin(), old_items.end(), new_items.begin(), new_items.end(), RKTOutputIterator< ElementList >(elements));
+	std::set_difference(old_items.begin(), old_items.end(), new_items.begin(), new_items.end(), std::back_inserter(elements));
 	std::for_each(elements.begin(), elements.end(), RKTEventFunctor(event, parameters, interruptible));
 }
 

+ 0 - 41
Source/Core/EventIterators.h

@@ -85,47 +85,6 @@ class PseudoClassFunctor
 		bool set;
 };
 
-/**
- * Generic output iterator for adding elements to a container
- * @author Lloyd
- */
-
-template<typename T>
-class RKTOutputIterator : public std::iterator< std::output_iterator_tag, void, void, void, void >
-{
-public:
-	RKTOutputIterator(T& _elements) : elements(_elements)
-	{
-	}
-
-	RKTOutputIterator &operator=(const typename T::value_type &v) 
-	{
-		// Store the given item
-		elements.push_back(v);
-		return *this;
-	}
-	
-	RKTOutputIterator &operator *()
-	{ 
-		// Always return the same object
-		return *this; 
-	}
-
-	RKTOutputIterator &operator ++()
-	{
-		// Always return the same object
-		return *this;
-	}
-	
-	RKTOutputIterator operator ++(int)
-	{
-		// Always return the same object
-		return *this;
-	}
-private:
-	T& elements;
-};
-
 }
 }