mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Added swap and list swap to stdlib.
This commit is contained in:
@@ -27,6 +27,13 @@ macro void @scope(&variable; @body) @autoimport
|
||||
@body();
|
||||
}
|
||||
|
||||
macro void @swap(&a, &b) @autoimport
|
||||
{
|
||||
$typeof(a) temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a variant type to a type, returning an failure if there is a type mismatch.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user