2.07.2011

For whimps

I decided to leave this "safe access" thing and only provide a function for checking an index' validity. It's still my toolkit after all and I don't appreciate the implementation of functions I wouldn't use. So all in all I kept it close to what you'd do in C or other lowlevel language. Range check on demand, leaving performance-eating stuff out. If I think about it, I followed another principle with my doubly linked list item class. It made it to have a completely 100% safe self-managing list structure with no seperation between items and list itself. The cool thing is that, while I only check if(!this) return; in the beginning, it gives some interesting aspects when allocating new elements. You can start the allocation an empty element and you get the pointer of newly added back. I think it's not necessary to check for this in every function. I should rework this one day, checking it only where it's really necessary. However, I like the approach and that you can keep it really, really minimal. Though I miss a singly linked variant I'll have to code some day, too. However, I'm pleased with how wonderfully minimal this base is. Oh I'm such fanboy of small code.

No comments: