aboutsummaryrefslogtreecommitdiff
path: root/strbuf.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-02-19 01:25:45 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-02-19 01:25:45 +0100
commit3362e2fb538c9426635e2fda8d9737662b48fc06 (patch)
treeb7fe6dc049bb7a86e5ece3500bafaf8992984f9c /strbuf.h
parentStarted full rewrite in C++. (diff)
downloadcalp-3362e2fb538c9426635e2fda8d9737662b48fc06.tar.gz
calp-3362e2fb538c9426635e2fda8d9737662b48fc06.tar.xz
I somehow got stuff to bulid, now it just doesn't link.
Diffstat (limited to 'strbuf.h')
-rw-r--r--strbuf.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/strbuf.h b/strbuf.h
index 07580f63..bf109daf 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -4,6 +4,7 @@
#include <unistd.h>
#include <cstdlib>
#include <cstring>
+#include <string>
/*
* A high level string type which holds it's own length, how much
@@ -32,11 +33,11 @@ struct strbuf {
*/
void realloc (size_t len);
- bool operator==(strbuf& other) {
- return strncmp(this->mem, other.mem, this->len) == 0;
- }
- bool operator==(char* other)
- { strncmp(this->mem, other, this->len) == 0 ; }
+ bool operator==(strbuf& other)
+ { return strncmp(this->mem, other.mem, this->len) == 0; }
+
+ bool operator==(const char* other)
+ { return strncmp(this->mem, other, this->len) == 0 ; }
strbuf& operator=(strbuf* other);