CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmArgumentParserTypes.h
blob3e0fae4404a0194279a490d4ea26f72eed851281
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #if defined(__SUNPRO_CC) || defined(__EDG__)
9 # include <string>
10 # include <vector>
12 namespace ArgumentParser {
14 template <typename T>
15 struct Maybe;
16 template <>
17 struct Maybe<std::string> : public std::string
19 using std::string::basic_string;
22 template <typename T>
23 struct MaybeEmpty;
24 template <typename T>
25 struct MaybeEmpty<std::vector<T>> : public std::vector<T>
27 using std::vector<T>::vector;
30 template <typename T>
31 struct NonEmpty;
32 template <typename T>
33 struct NonEmpty<std::vector<T>> : public std::vector<T>
35 using std::vector<T>::vector;
37 template <>
38 struct NonEmpty<std::string> : public std::string
40 using std::string::basic_string;
43 } // namespace ArgumentParser
45 #else
47 namespace ArgumentParser {
49 template <typename T>
50 struct Maybe : public T
52 using T::T;
55 template <typename T>
56 struct MaybeEmpty : public T
58 using T::T;
61 template <typename T>
62 struct NonEmpty : public T
64 using T::T;
67 } // namespace ArgumentParser
69 #endif