In Field (which represents the Sudoku playing field) there are 9*9 cells, all numbers that are written in a cell are collectively stored in a NumberSet.
Now should I (in Field) use getters (which return a NumberSet) and setters (which replace the old NumberSet with a new one)? This does allow for const getter functions.
Or should I make a getter that returns a NumberSet pointer, which then allows you to edit/manipulate the cells NumberSet in place (thus being faster and more efficient, but maybe getting somewhat odd in const functions)?
Which would be the best solution, and why?
In
Field(which represents the Sudoku playing field) there are 9*9 cells, all numbers that are written in a cell are collectively stored in aNumberSet.Now should I (in Field) use getters (which return a NumberSet) and setters (which replace the old NumberSet with a new one)? This does allow for const getter functions.
Or should I make a getter that returns a NumberSet pointer, which then allows you to edit/manipulate the cells NumberSet in place (thus being faster and more efficient, but maybe getting somewhat odd in const functions)?
Which would be the best solution, and why?