AlmightySnoo 🐢🇮🇱🇺🇦@lemmy.world to Programmer Humor@lemmy.ml · 1 year agopointers are very elegantolemmy.worldimagemessage-square39fedilinkarrow-up1683arrow-down124
arrow-up1659arrow-down1imagepointers are very elegantolemmy.worldAlmightySnoo 🐢🇮🇱🇺🇦@lemmy.world to Programmer Humor@lemmy.ml · 1 year agomessage-square39fedilink
minus-squareZILtoid1991@kbin.sociallinkfedilinkarrow-up1·1 year agoHere’s a true example from my collections library: https://github.com/ZILtoid1991/collections-d/blob/05e51c1acdd0bb583fbb8548c79d1b3fbaff37cc/source/collections/linkedlist.d#L75 This one uses a bit safer reference to a pointer: https://github.com/ZILtoid1991/collections-d/blob/05e51c1acdd0bb583fbb8548c79d1b3fbaff37cc/source/collections/treemap.d#L662C1-L685C3 Basically it allows me to modify a pointer easily.
Here’s a true example from my collections library:
https://github.com/ZILtoid1991/collections-d/blob/05e51c1acdd0bb583fbb8548c79d1b3fbaff37cc/source/collections/linkedlist.d#L75
This one uses a bit safer reference to a pointer:
https://github.com/ZILtoid1991/collections-d/blob/05e51c1acdd0bb583fbb8548c79d1b3fbaff37cc/source/collections/treemap.d#L662C1-L685C3
Basically it allows me to modify a pointer easily.