summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-03 08:12:34 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-05-04 20:32:21 (GMT)
commit013ada80eac9cb119a6288ee58724a8c9915a35c (patch)
tree04739c03393e31427fae0acbca7057c97ffb41e9 /Source/cmPolicies.h
parentbe6664c208c65e01dc175ae4d27e7fc18c28c97e (diff)
downloadCMake-013ada80eac9cb119a6288ee58724a8c9915a35c.zip
CMake-013ada80eac9cb119a6288ee58724a8c9915a35c.tar.gz
CMake-013ada80eac9cb119a6288ee58724a8c9915a35c.tar.bz2
cmPolicies: Implement PolicyMap in terms of bitset.
Diffstat (limited to 'Source/cmPolicies.h')
-rw-r--r--Source/cmPolicies.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 46b725a..63376dd 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -14,6 +14,8 @@
#include "cmCustomCommand.h"
+#include <bitset>
+
class cmMakefile;
class cmPolicy;
@@ -268,12 +270,20 @@ public:
static std::string GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id);
/** Represent a set of policy values. */
- struct PolicyMap : private std::map<PolicyID, PolicyStatus>
+ struct PolicyMap
{
+ PolicyMap();
PolicyStatus Get(PolicyID id) const;
void Set(PolicyID id, PolicyStatus status);
bool IsDefined(PolicyID id) const;
bool IsEmpty() const;
+
+ private:
+ std::bitset<cmPolicies::CMPCOUNT> UNDEFINED;
+ std::bitset<cmPolicies::CMPCOUNT> OLD;
+ std::bitset<cmPolicies::CMPCOUNT> NEW;
+ std::bitset<cmPolicies::CMPCOUNT> REQUIRED_IF_USED;
+ std::bitset<cmPolicies::CMPCOUNT> REQUIRED_ALWAYS;
};
};