Tuesday, January 19, 2016

Day 10: Time Flies When You're Iterating

Phew! Today just never stopped being busy. Been implementing an iterator for that singly-linked list I've been working on.

Thankfully the equality operators (==, !=) only apply to the implied node that the iterator holds and not the data itself; user-defined types like the one I had to put in today don't have that functionality.

Heck, I also didn't know "user-defined types" does not refer to typenamed things like int32_t (see <cstdint>) but to classes we make ourselves. I swear, these assignments get shiftier and less clear every day...

As for the current thingamabob I'm stuck on, it refers to the Remove method I've been trying to implement for the singly linked list. If I'm looking to remove an item, where would I stop when checking?

...just got an idea for checking it.node->next! That could work!

No comments:

Post a Comment