summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-29 13:21:20 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-29 13:28:35 (GMT)
commit8a4ca110e49c64c4892a37ffe08a91a5a5219acf (patch)
treefc0ea487105b9ecee8c98d5c6c23dbafe4c77ed4 /Source/cmComputeLinkInformation.h
parent83ad066ed10ccabc4331c4b620ad6a4fa0cd36ba (diff)
downloadCMake-8a4ca110e49c64c4892a37ffe08a91a5a5219acf.zip
CMake-8a4ca110e49c64c4892a37ffe08a91a5a5219acf.tar.gz
CMake-8a4ca110e49c64c4892a37ffe08a91a5a5219acf.tar.bz2
cmComputeLinkInformation: Improve type safety of item IsPath member
Use an enum to avoid implicit conversions to bool.
Diffstat (limited to 'Source/cmComputeLinkInformation.h')
-rw-r--r--Source/cmComputeLinkInformation.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 4acb99f..9afa0eb 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -35,17 +35,24 @@ public:
~cmComputeLinkInformation();
bool Compute();
+ enum class ItemIsPath
+ {
+ No,
+ Yes,
+ };
+
struct Item
{
Item() = default;
- Item(BT<std::string> v, bool p, cmGeneratorTarget const* target = nullptr)
+ Item(BT<std::string> v, ItemIsPath isPath,
+ cmGeneratorTarget const* target = nullptr)
: Value(std::move(v))
- , IsPath(p)
+ , IsPath(isPath)
, Target(target)
{
}
BT<std::string> Value;
- bool IsPath = true;
+ ItemIsPath IsPath = ItemIsPath::Yes;
cmGeneratorTarget const* Target = nullptr;
};
using ItemVector = std::vector<Item>;