mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
More deprecations in lib6, and updates to lib7
This commit is contained in:
@@ -14,7 +14,19 @@ struct ByteWriter (OutStream)
|
||||
@require self.bytes.len == 0 "Init may not run on already initialized data"
|
||||
@ensure (bool)allocator, self.index == 0
|
||||
*>
|
||||
fn ByteWriter* ByteWriter.new_init(&self, Allocator allocator = allocator::heap())
|
||||
fn ByteWriter* ByteWriter.new_init(&self, Allocator allocator = allocator::heap()) @deprecated("Use init(mem)")
|
||||
{
|
||||
*self = { .bytes = {}, .allocator = allocator };
|
||||
return self;
|
||||
}
|
||||
|
||||
<*
|
||||
@param [&inout] self
|
||||
@param [&inout] allocator
|
||||
@require self.bytes.len == 0 "Init may not run on already initialized data"
|
||||
@ensure (bool)allocator, self.index == 0
|
||||
*>
|
||||
fn ByteWriter* ByteWriter.init(&self, Allocator allocator)
|
||||
{
|
||||
*self = { .bytes = {}, .allocator = allocator };
|
||||
return self;
|
||||
@@ -25,9 +37,19 @@ fn ByteWriter* ByteWriter.new_init(&self, Allocator allocator = allocator::heap(
|
||||
@require self.bytes.len == 0 "Init may not run on already initialized data"
|
||||
@ensure self.index == 0
|
||||
*>
|
||||
fn ByteWriter* ByteWriter.temp_init(&self)
|
||||
fn ByteWriter* ByteWriter.tinit(&self)
|
||||
{
|
||||
return self.new_init(allocator::temp()) @inline;
|
||||
return self.init(allocator::temp()) @inline;
|
||||
}
|
||||
|
||||
<*
|
||||
@param [&inout] self
|
||||
@require self.bytes.len == 0 "Init may not run on already initialized data"
|
||||
@ensure self.index == 0
|
||||
*>
|
||||
fn ByteWriter* ByteWriter.temp_init(&self) @deprecated("Use tinit")
|
||||
{
|
||||
return self.init(allocator::temp()) @inline;
|
||||
}
|
||||
|
||||
fn ByteWriter* ByteWriter.init_with_buffer(&self, char[] data)
|
||||
|
||||
Reference in New Issue
Block a user