mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix to "typeid.kind". Conversion unsigned int -> enum fixed. @autoimport -> @builtin. Comparison macros. Bump to 0.2.21
This commit is contained in:
committed by
Christoffer Lerno
parent
036859c0c8
commit
b313bec69d
32
test/test_suite/stdlib/priorityqueue.c3t
Normal file
32
test/test_suite/stdlib/priorityqueue.c3t
Normal file
@@ -0,0 +1,32 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
import std::io;
|
||||
import std::math;
|
||||
import std::priorityqueue;
|
||||
|
||||
define FooPriorityQueue = PriorityQueue<Foo>;
|
||||
|
||||
fn void main()
|
||||
{
|
||||
|
||||
FooPriorityQueue agh;
|
||||
agh.max = true;
|
||||
agh.push(Foo { 3 });
|
||||
agh.push(Foo { 101 });
|
||||
agh.push(Foo { 10 });
|
||||
while (try f = agh.pop()) io::printf("%s\n", f.x);
|
||||
}
|
||||
|
||||
struct Foo
|
||||
{
|
||||
int x;
|
||||
}
|
||||
|
||||
fn bool Foo.less(Foo* x, Foo y) @inline
|
||||
{
|
||||
return x.x < y.x;
|
||||
}
|
||||
|
||||
// #expect: test.ll
|
||||
|
||||
%PriorityQueue = type { %List, i8 }
|
||||
Reference in New Issue
Block a user