Files
c3c/test/test_suite/stdlib/priorityqueue.c3t
Christoffer Lerno 8b49e6c14d Rename def to alias.
2025-03-13 11:22:27 +01:00

32 lines
472 B
Plaintext

// #target: macos-x64
module test;
import std::io;
import std::math;
import std::collections::priorityqueue;
alias FooPriorityQueue = PriorityQueueMax{Foo};
fn void main()
{
FooPriorityQueue agh;
agh.push((Foo) { 3 });
agh.push((Foo) { 101 });
agh.push({ 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
%PrivatePriorityQueue = type { %List }