summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSebastien Braun2010-10-10 14:31:25 +0200
committerSebastien Braun2010-10-11 00:55:34 +0200
commitf6d1c5346fc3b950fe31f7f6f920699e9835cb62 (patch)
treef07ccf583ddecbc86f6497520c0ebd7c1b81cf88 /src
parentRemove input headers from PVSMGR_SRCS in CMakeLists.txt as they do not contri... (diff)
downloadpvs-f6d1c5346fc3b950fe31f7f6f920699e9835cb62.tar.gz
pvs-f6d1c5346fc3b950fe31f7f6f920699e9835cb62.tar.xz
pvs-f6d1c5346fc3b950fe31f7f6f920699e9835cb62.zip
Fix bug in logical OR when chaining Require<...> Policy.
Diffstat (limited to 'src')
-rw-r--r--src/input/inputEventHandler.h9
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&)
{