Commit 9fb72577 authored by Philipp Götze's avatar Philipp Götze
Browse files

Added equal comparison operator for StringRef

parent 2bee597e
......@@ -20,8 +20,9 @@
#ifndef STRINGREF_HPP_
#define STRINGREF_HPP_
namespace pfabric {
#include <string>
namespace pfabric {
/**
* TODO docs
......@@ -65,9 +66,13 @@ struct StringRef {
int size_;
};
inline bool operator==(const StringRef &a, const StringRef &b) {
//TODO: Should this be based on pointer and size or content?
std::string s1 (a.begin_, a.size_);
std::string s2 (b.begin_, b.size_);
return (s1 == s2);
}
} /* end namespace pfabric */
#endif /* STRINGREF_HPP_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment