Skip to content

Commit

Permalink
BoutMask: Add non-const operator[](Ind3D)
Browse files Browse the repository at this point in the history
Enables elements of BoutMask to be assigned using an Ind3D as index.
Previously only (i,j,k) available, and const [Ind3D].
  • Loading branch information
bendudson committed Oct 8, 2024
1 parent 3a91595 commit 7125330
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/bout/mask.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public:

inline bool& operator()(int jx, int jy, int jz) { return mask(jx, jy, jz); }
inline const bool& operator()(int jx, int jy, int jz) const { return mask(jx, jy, jz); }

inline bool& operator[](const Ind3D& i) { return mask[i]; }
inline const bool& operator[](const Ind3D& i) const { return mask[i]; }
};

Expand Down

0 comments on commit 7125330

Please sign in to comment.