Closed aep closed 4 years ago
ohhhh yeah! checking this out now
there's a pretty ugly edge case
fn dump(void+vt * obj) {
log::info("dumping object of size %d", vt);
}
fn ftail(Buffer+xt * obj) {
dump(obj);
}
call to dump binds any explicit type tail binding first, so in this case whatever xt is instead of sizeof(Buffer) + xt
i should probably research how to auto cast into slice instead.
never mind, i fixed it instead
nice hell yeah
this enables building functions that take "any object and its size", specifically memory pools for generic containers.
Since we do not allow template functions, this is getting us closer to generic functions
i'd imagine something like