We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4c8350 commit f607156Copy full SHA for f607156
include/co/fast.h
@@ -123,6 +123,10 @@ class __coapi stream {
123
_p = cap > 0 ? (char*)co::alloc(cap) : 0;
124
}
125
126
+ stream(char* p, size_t cap, size_t size)
127
+ : _cap(cap), _size(size), _p(p) {
128
+ }
129
+
130
~stream() { this->reset(); }
131
132
stream(const stream&) = delete;
include/co/fastring.h
@@ -41,6 +41,10 @@ class __coapi fastring : public fast::stream {
41
memset(_p, c, n);
42
43
44
+ fastring(char* p, size_t cap, size_t size)
45
+ : fast::stream(p, cap, size) {
46
47
48
fastring(const void* s, size_t n)
49
: fast::stream(n + !!n, n) {
50
memcpy(_p, s, n);
0 commit comments