On Tuesday 30 July 2024 at 21:54:32 UTC+1 William Gilmore wrote:
func DCT2DFast8(in []float64) (out [64]) {...} - Optimized static code, 0
allocations when called directly. See following benchmark.
I am guessing return should be something like *out [64]float64* ?
Ideally, I would like for the following to work:
return (DCT2DFast8(result)[:]
(Aside: parentheses don't match)
Unfortunately, this does not since the function's return value is transient
and the slice expression cannot operate on it.
By "transient" I think you mean "not addressable". Try returning a pointer
to the array, instead of an array value:
https://go.dev/play/p/4CTek2r78sk
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/27fd8942-7e9f-4bd8-b3f0-6a3bea5d5cdfn%40googlegroups.com.