Andreas Scheja
08/31/2026, 7:50 PMCVariable wrapper? see 🧵Andreas Scheja
08/31/2026, 7:50 PMval bools = allocArray<BooleanVar>(count)
val ints = allocArray<IntVar>(count)
where I want to pass a single element each to a function
fun foo(bar: BooleanVar, baz: IntVar)
I can just use the default version of operator fun <reified T : CVariable> CPointer<T>.get(index: Int): T for bar (returning BooleanVar),
while with foo I end up with operator fun <T : Int> CPointer<IntVarOf<T>>.get(index: Int): T (returning Int). So instead of having a call like
foo(bools[index], ints[index])
I end up with something like
foo(bools[index], (ints + index)!!.pointed)
To me this feels very inconsistent?Youssef Shoaib [MOD]
08/31/2026, 9:47 PMints.get<IntVar>(index)