summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-26 18:03:32 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-27 11:03:31 (GMT)
commit77fcb00a2b76518c0db861a96a8f4857a50b140e (patch)
tree114e4ae50d6f1679f6ef0344bd4d1d70e371ffc7 /Source
parent5fc4e121a18d9e403f1541348c2889e9bc153791 (diff)
downloadCMake-77fcb00a2b76518c0db861a96a8f4857a50b140e.zip
CMake-77fcb00a2b76518c0db861a96a8f4857a50b140e.tar.gz
CMake-77fcb00a2b76518c0db861a96a8f4857a50b140e.tar.bz2
cmArgumentParser: Propagate constructors through binding wrapper types
Diffstat (limited to 'Source')
-rw-r--r--Source/cmArgumentParserTypes.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/Source/cmArgumentParserTypes.h b/Source/cmArgumentParserTypes.h
index 9afa5c7..fe8e4ca 100644
--- a/Source/cmArgumentParserTypes.h
+++ b/Source/cmArgumentParserTypes.h
@@ -4,21 +4,61 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#if defined(__SUNPRO_CC)
+
+# include <string>
+# include <vector>
+
+namespace ArgumentParser {
+
+template <typename T>
+struct Maybe;
+template <>
+struct Maybe<std::string> : public std::string
+{
+ using std::string::basic_string;
+};
+
+template <typename T>
+struct MaybeEmpty;
+template <typename T>
+struct MaybeEmpty<std::vector<T>> : public std::vector<T>
+{
+ using std::vector<T>::vector;
+};
+
+template <typename T>
+struct NonEmpty;
+template <typename T>
+struct NonEmpty<std::vector<T>> : public std::vector<T>
+{
+ using std::vector<T>::vector;
+};
+
+} // namespace ArgumentParser
+
+#else
+
namespace ArgumentParser {
template <typename T>
struct Maybe : public T
{
+ using T::T;
};
template <typename T>
struct MaybeEmpty : public T
{
+ using T::T;
};
template <typename T>
struct NonEmpty : public T
{
+ using T::T;
};
} // namespace ArgumentParser
+
+#endif