@@ -28,6 +28,45 @@ enum class update_notifications : uint8_t
2828 off // !< Automatic update notifications should be disabled.
2929};
3030
31+ /* !\brief A `std::vector<std::string>` that can also be constructed from `std::string`.
32+ * \ingroup misc
33+ * \details
34+ * \experimentalapi{Experimental since version 1.2.0.}
35+ */
36+ class vector_of_string : public std ::vector<std::string>
37+ {
38+ private:
39+ // !\brief The base type.
40+ using base_t = std::vector<std::string>;
41+
42+ public:
43+ using base_t ::base_t ;
44+
45+ vector_of_string () = default ; // !< Defaulted.
46+ vector_of_string (vector_of_string const &) = default ; // !< Defaulted.
47+ vector_of_string & operator =(vector_of_string const &) = default ; // !< Defaulted.
48+ vector_of_string (vector_of_string &&) = default ; // !< Defaulted.
49+ vector_of_string & operator =(vector_of_string &&) = default ; // !< Defaulted.
50+ ~vector_of_string () = default ; // !< Defaulted.
51+
52+ // !\brief Delegate to `std::string` constructor if possible.
53+ template <typename ... t>
54+ requires std::constructible_from<std::string, t...>
55+ constexpr vector_of_string (t &&... str) : base_t{std::string (std::forward<t>(str)...)}
56+ {}
57+
58+ // !\brief Construct from iterator pair.
59+ template <typename Iter>
60+ requires std::constructible_from<std::string, Iter, Iter>
61+ && std::same_as<std::decay_t <Iter>, std::string::value_type *>
62+ constexpr vector_of_string (Iter begin, Iter end) : base_t{std::string (begin, end)}
63+ {}
64+
65+ // !\brief Construct from an initializer list.
66+ constexpr vector_of_string (std::initializer_list<std::string::value_type> il) : base_t{{il}}
67+ {}
68+ };
69+
3170/* !\brief Stores all parser related meta information of the sharg::parser.
3271 * \ingroup parser
3372 * \details
@@ -78,8 +117,8 @@ struct parser_meta_data // holds all meta information
78117 */
79118 std::string long_copyright;
80119
81- // !\brief How users shall cite your application.
82- std::string citation;
120+ // !\brief How users shall cite your application.
121+ vector_of_string citation;
83122
84123 /* !\brief The title of your man page when exported by specifying
85124 * "--export-help man" on the common line.
0 commit comments