diff options
author | Sebastien Braun | 2010-10-10 14:31:25 +0200 |
---|---|---|
committer | Sebastien Braun | 2010-10-11 00:55:34 +0200 |
commit | f6d1c5346fc3b950fe31f7f6f920699e9835cb62 (patch) | |
tree | f07ccf583ddecbc86f6497520c0ebd7c1b81cf88 | |
parent | Remove input headers from PVSMGR_SRCS in CMakeLists.txt as they do not contri... (diff) | |
download | pvs-f6d1c5346fc3b950fe31f7f6f920699e9835cb62.tar.gz pvs-f6d1c5346fc3b950fe31f7f6f920699e9835cb62.tar.xz pvs-f6d1c5346fc3b950fe31f7f6f920699e9835cb62.zip |
Fix bug in logical OR when chaining Require<...> Policy.
-rw-r--r-- | src/input/inputEventHandler.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/input/inputEventHandler.h b/src/input/inputEventHandler.h index 3879b80..11e2f4e 100644 --- a/src/input/inputEventHandler.h +++ b/src/input/inputEventHandler.h @@ -102,8 +102,10 @@ template<IMPLICIT_TYPE_LIST_PARAMS(Trait)> BEGIN_POLICY_CLASS(Require) { static const bool areSystemRequirementsFulfilled = - NextPolicy::areSystemRequirementsFulfilled || - detail::Matches<AllOf<IMPLICIT_TYPE_LIST_ARGS(Trait)>, detail::SystemTraits>::value; + (NextPolicy::areSystemRequirementsFulfilled + && !NextPolicy::areSystemRequirementsVacuouslyFulfilled) + || detail::Matches<AllOf<IMPLICIT_TYPE_LIST_ARGS(Trait)>, detail::SystemTraits>::value; + static const bool areSystemRequirementsVacuouslyFulfilled = false; } END_POLICY_CLASS @@ -158,6 +160,9 @@ struct InputEventHandlerPolicyBase // everywhere static const bool areSystemRequirementsFulfilled = true; + // We need this to implement proper logical OR + static const bool areSystemRequirementsVacuouslyFulfilled = true; + // Generate an error when no match policy is given. bool isApplicable(InputEvent const&) { |