@@ -28,6 +28,40 @@ 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+ class vector_of_string : public std ::vector<std::string>
33+ {
34+ private:
35+ using base_t = std::vector<std::string>;
36+
37+ public:
38+ using base_t ::base_t ;
39+
40+ vector_of_string () = default ; // !< Defaulted.
41+ vector_of_string (vector_of_string const &) = default ; // !< Defaulted.
42+ vector_of_string & operator =(vector_of_string const &) = default ; // !< Defaulted.
43+ vector_of_string (vector_of_string &&) = default ; // !< Defaulted.
44+ vector_of_string & operator =(vector_of_string &&) = default ; // !< Defaulted.
45+ ~vector_of_string () = default ; // !< Defaulted.
46+
47+ // !\brief Delegate to `std::string` constructor if possible.
48+ template <typename ... t>
49+ requires std::constructible_from<std::string, t...>
50+ constexpr vector_of_string (t &&... str) : base_t{std::string (std::forward<t>(str)...)}
51+ {}
52+
53+ // !\brief Construct from iterator pair.
54+ template <typename Iter>
55+ requires std::constructible_from<std::string, Iter, Iter>
56+ && std::same_as<std::decay_t <Iter>, std::string::value_type *>
57+ constexpr vector_of_string (Iter begin, Iter end) : base_t{std::string (begin, end)}
58+ {}
59+
60+ // !\brief Construct from an initializer list.
61+ constexpr vector_of_string (std::initializer_list<std::string::value_type> il) : base_t{{il}}
62+ {}
63+ };
64+
3165/* !\brief Stores all parser related meta information of the sharg::parser.
3266 * \ingroup parser
3367 * \details
@@ -43,19 +77,6 @@ enum class update_notifications : uint8_t
4377 */
4478struct parser_meta_data // holds all meta information
4579{
46- // These are only needed to silence the deprecation warning for `citation`.
47- // !\cond
48- #pragma GCC diagnostic push
49- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
50- parser_meta_data () = default ;
51- parser_meta_data (parser_meta_data const &) = default ;
52- parser_meta_data & operator =(parser_meta_data const &) = default ;
53- parser_meta_data (parser_meta_data &&) = default ;
54- parser_meta_data & operator =(parser_meta_data &&) = default ;
55- ~parser_meta_data () = default ;
56- #pragma GCC diagnostic pop
57- // !\endcond
58-
5980 /* !\brief The application name that will be displayed on the help page.
6081 *
6182 * The application name must only contain alpha-numeric characters, '_' or '-',
@@ -91,15 +112,8 @@ struct parser_meta_data // holds all meta information
91112 */
92113 std::string long_copyright;
93114
94- /* !\brief How users shall cite your application.
95- * \deprecated This member is deprecated, please use `sharg::parser_meta_data::citations` instead.
96- */
97- SHARG_DEPRECATED_200 (" sharg::parser::info::citation (std::string) will be removed in Sharg 2.0.0. " ,
98- " Please use sharg::parser::info::citations (std::vector<std::string>) instead." )
99- std::string citation;
100-
101115 // !\brief How users shall cite your application.
102- std::vector<std::string> citations ;
116+ vector_of_string citation ;
103117
104118 /* !\brief The title of your man page when exported by specifying
105119 * "--export-help man" on the common line.
0 commit comments