package main
import "core:fmt"
function_with_location :: proc() {}
function_without_location :: proc(i: $T) {}
main :: proc() {
fmt.println("function_with_location: ", function_with_location)
// Since function_without_location is created for each T we use it with it does not have a location by itself
// But what if I want the instance of function_without_location for some specific T=int
// This must reside somewhere in the memory, but I don't see how to find this location
fmt.println("function_without_location: ", function_without_location)
}
main.odin(13:45) Error: Cannot assign value 'function_without_location' of type 'proc($T)' to 'any' in a procedure argument
... rintln("function_without_location: ", function_without_location)
When commented out
function_with_location: proc() @ 0x43B670
As you can see the generic function does not have an address, since an instance would be created for a specific T.
How would I get the address of the instance used when I say
i :int= 4
// The below call must go to some function in memory
// The address of that function is what I want
function_without_location(i)
Does anyone know a way to get the address of a specific generic function instance?