[icinga-checkins] icinga.org: icinga2/master: Fixed incorrect use of boost::algorithm:: is_iless.

git at icinga.org git at icinga.org
Wed Oct 31 12:06:43 CET 2012


Module: icinga2
Branch: master
Commit: 482742f00e1575aa5072741e8dc1eff288f5690e
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=482742f00e1575aa5072741e8dc1eff288f5690e

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Wed Oct 31 12:06:21 2012 +0100

Fixed incorrect use of boost::algorithm::is_iless.

---

 lib/base/dynamicobject.h |    8 ++++----
 lib/base/qstring.h       |    9 +++++++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/lib/base/dynamicobject.h b/lib/base/dynamicobject.h
index 651d7cc..e7f4814 100644
--- a/lib/base/dynamicobject.h
+++ b/lib/base/dynamicobject.h
@@ -74,11 +74,11 @@ public:
 
 	typedef function<DynamicObject::Ptr (const Dictionary::Ptr&)> Factory;
 
-	typedef map<String, Factory, boost::algorithm::is_iless> ClassMap;
-	typedef map<String, DynamicObject::Ptr, boost::algorithm::is_iless> NameMap;
-	typedef map<String, NameMap, boost::algorithm::is_iless> TypeMap;
+	typedef map<String, Factory, string_iless> ClassMap;
+	typedef map<String, DynamicObject::Ptr, string_iless> NameMap;
+	typedef map<String, NameMap, string_iless> TypeMap;
 
-	typedef map<String, DynamicAttribute, boost::algorithm::is_iless> AttributeMap;
+	typedef map<String, DynamicAttribute, string_iless> AttributeMap;
 	typedef AttributeMap::iterator AttributeIterator;
 	typedef AttributeMap::const_iterator AttributeConstIterator;
 
diff --git a/lib/base/qstring.h b/lib/base/qstring.h
index b5fe1c8..4cd81b1 100644
--- a/lib/base/qstring.h
+++ b/lib/base/qstring.h
@@ -118,6 +118,15 @@ I2_BASE_API String::ConstIterator range_begin(const String& x);
 I2_BASE_API String::Iterator range_end(String& x);
 I2_BASE_API String::ConstIterator range_end(const String& x);
 
+struct string_iless : std::binary_function<String, String, bool>
+{
+	bool operator()(const String& s1, const String& s2) const
+	{
+		return lexicographical_compare(s1.Begin(), s1.End(),
+		    s2.Begin(), s2.End(), boost::algorithm::is_iless());
+	}
+};
+
 }
 
 namespace boost





More information about the icinga-checkins mailing list