@@ -261,9 +261,10 @@ class parser
261261 // !\cond DEV
262262 // !\brief A poison overload that catches calls to add_option without explicitly passing a sharg::config.
263263 template <typename option_type>
264+ requires (parsable<option_type> || parsable<std::ranges::range_value_t <option_type>>)
264265 void add_option (option_type &, detail::poison_config const &)
265266 {
266- static_assert (false , " Forgot sharg::config?" );
267+ static_assert (detail::dependent_false_v<option_type> , " Forgot sharg::config?" );
267268 }
268269 // !\endcond
269270
@@ -302,7 +303,7 @@ class parser
302303 requires std::same_as<option_type, bool >
303304 void add_flag (option_type &, detail::poison_config const &)
304305 {
305- static_assert (false , " Forgot sharg::config?" );
306+ static_assert (detail::dependent_false_v<option_type> , " Forgot sharg::config?" );
306307 }
307308 // !\endcond
308309
@@ -351,9 +352,10 @@ class parser
351352 // !\cond DEV
352353 // !\brief A poison overload that catches calls to add_positional_option without explicitly passing a sharg::config.
353354 template <typename option_type>
355+ requires (parsable<option_type> || parsable<std::ranges::range_value_t <option_type>>)
354356 void add_positional_option (option_type &, detail::poison_config const &)
355357 {
356- static_assert (false , " Forgot sharg::config?" );
358+ static_assert (detail::dependent_false_v<option_type> , " Forgot sharg::config?" );
357359 }
358360 // !\endcond
359361
@@ -1011,3 +1013,5 @@ class parser
10111013};
10121014
10131015} // namespace sharg
1016+
1017+
0 commit comments