Skip to content

Instantly share code, notes, and snippets.

@AlexanderBrevig
Created August 13, 2013 03:26
Show Gist options
  • Save AlexanderBrevig/6217634 to your computer and use it in GitHub Desktop.
Save AlexanderBrevig/6217634 to your computer and use it in GitHub Desktop.
class PropertyTester {
public:
PropertyTester()
: threshold()
, increment(PropertyTester::incrementAssignSafetyGuard)
, isIncrementing(_isIncrementing) {
_isIncrementing = true;
}
Property<int> threshold;
ConstrainedProperty<int> increment;
ConstantProperty<bool> isIncrementing;
private:
static bool incrementAssignSafetyGuard(int a) {
return a > 0;
}
bool _isIncrementing;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment