mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
21 lines
282 B
C
21 lines
282 B
C
public test;
|
|
|
|
/**
|
|
* @require parse(a = b), parse(b = a)
|
|
*/
|
|
public macro void swap(&a, &b)
|
|
{
|
|
typeof(a) temp = a;
|
|
a = b;
|
|
b = temp;
|
|
}
|
|
|
|
/**
|
|
* @require parse(a = b), parse(b = a)
|
|
*/
|
|
public macro void swap2(auto &a, auto &b)
|
|
{
|
|
auto temp = a;
|
|
a = b;
|
|
b = temp;
|
|
} |