Re:More Dirty Coding Tricks from Game Developers (2010)
by kybernetyk on Monday August 03, 2015 @04:03AM
(#9994357)
Yes, and what's wrong with that? You certainly don't want someone from the outside altering the nodes directly if you have an API which should be used instead.
Whenever I need to return a non-const reference/pointer to some inner data (which is not often) I name the method "mutableFoo()" to make clear what you're getting.
But most of the time (provided a sane API design) you won't have that problem anyway.
Whenever I need to return a non-const reference/pointer to some inner data (which is not often) I name the method "mutableFoo()" to make clear what you're getting.
But most of the time (provided a sane API design) you won't have that problem anyway.