>Brick& get_brick_at(const Position & p) {
return board[p.get_row()][p.get_column()];
}
Now, of course this does not work since the compiler cannot convert from long int to a Position. So how do i know if the return value of get_brick_at is garbage?
I also have a couple of other situations where i want to return some kind of NULL-like value under certain circumstances.
My question is: How do i handle situations like that?
Well okay, but then i'm forced to use the new keyword to allocate the Position variable get_brick_at returns? Which could result in memory leaks if i'm uncareful? Is that really the best/only way to do it?