Skip to content

Field: use getters and setters or pointers to edit NumberSets? #3

Description

@sjaak31367

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions