From 332aeba844dc49167d54a45c73b198c91b7ca62f Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Sun, 12 Jan 2014 00:00:53 +0100 Subject: [PATCH] util/string.h: String::operator == --- base/include/util/string.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base/include/util/string.h b/base/include/util/string.h index e106ada0f..412933483 100644 --- a/base/include/util/string.h +++ b/base/include/util/string.h @@ -480,6 +480,12 @@ namespace Genode { return (_length <= CAPACITY) && (_buf[_length - 1] == '\0'); } char const *string() const { return valid() ? _buf : ""; } + + template + bool operator == (String const &other) const + { + return strcmp(string(), other.string()) == 0; + } }; }