On 17 Jul 2023, at 14:50, Leonard Mittmann <leonard.mittm...@gmail.com> wrote:

Yes, but my thought was that it might be possible to do an unsafe conversion as 
the underlying types are the same. I just have no idea how.

https://go.dev/play/p/ViLnLvInv-1

The unsafe conversion appears to work, but it’s unsafe and not obvious to me 
that this is guaranteed to work. It’s allowed to convert one pointer to another 
if they have an “equivalent memory layout”, and I would guess that two map 
types with equivalent underlying types would share memory layout, but I don’t 
think the specs say anything about map memory layouts one way or the other.

//jb

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/AA75B829-B48F-4207-8D5F-9B75B2D17FAD%40kastelo.net.

Reply via email to