Skip to content

Instantly share code, notes, and snippets.

@isoiphone
Created June 3, 2013 20:35
Show Gist options
  • Save isoiphone/5701171 to your computer and use it in GitHub Desktop.
Save isoiphone/5701171 to your computer and use it in GitHub Desktop.
An obvious implementation of 'dirty bit' or 'dirty flag' optimization.
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