Original Post
I've just recently realized it's possible to cast to override a const trait on a variable type. Seems a little too easy in fact..? Anyway, here's the situation I'm in. My characters allow const access to their inventory. The inventory menu uses this access to set up lists and such for the interface. But when it comes time to signal the character to make inventory changes, I need to send the equip/unequip item pointers to the character task function. The funny thing is that these pointers are const, and the character obviously can't change equipped status on them. So they need a non-const pointer to the item. From my knowledge, there are two things I could do. One is to simply cast it to non-const. But damn that seems like a backwards thing to do. The other would be to search for the item in their inventory locations and find the same item - obtaining a normal non-const pointer. That seems pretty backwards too! Any suggestions?