summaryrefslogtreecommitdiffstats
path: root/Source/cmArgumentParserTypes.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-06 15:30:22 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-07 13:48:58 (GMT)
commite6d1e29ffa6bd3141a769d1281f3407ed0774139 (patch)
tree667e168e1643d72da6c88433c3c71a26c4fdcb0e /Source/cmArgumentParserTypes.h
parent4c50f639c7e67098eba14bc41869dd5c354d0da6 (diff)
downloadCMake-e6d1e29ffa6bd3141a769d1281f3407ed0774139.zip
CMake-e6d1e29ffa6bd3141a769d1281f3407ed0774139.tar.gz
CMake-e6d1e29ffa6bd3141a769d1281f3407ed0774139.tar.bz2
cmArgumentParser: Model maybe-empty and non-empty lists with wrapper types
Previously bindings to `std::vector<std::string>` required at least one value. Some clients have been filtering `keywordsMissingValue` to support keywords followed by empty lists. Instead, require clients to specify whether a keyword's list can be empty as part of the binding type.
Diffstat (limited to 'Source/cmArgumentParserTypes.h')
-rw-r--r--Source/cmArgumentParserTypes.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmArgumentParserTypes.h b/Source/cmArgumentParserTypes.h
new file mode 100644
index 0000000..7d4ce6f
--- /dev/null
+++ b/Source/cmArgumentParserTypes.h
@@ -0,0 +1,19 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+namespace ArgumentParser {
+
+template <typename T>
+struct MaybeEmpty : public T
+{
+};
+
+template <typename T>
+struct NonEmpty : public T
+{
+};
+
+} // namespace ArgumentParser