Created
June 3, 2013 20:35
-
-
Save isoiphone/5701171 to your computer and use it in GitHub Desktop.
An obvious implementation of 'dirty bit' or 'dirty flag' optimization.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DirtyFlag | |
{ | |
public: | |
DirtyFlag() : _dirty(true) {} | |
void setDirty(bool dirty=true) { _dirty = dirty; } | |
bool dirty() const { return _dirty; } | |
private: | |
bool _dirty; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment