|
|
@@ -162,6 +162,22 @@ template <typename Impl> bool Arguments<Impl>::Option::primed() const {
|
|
|
|
|
|
namespace program {
|
|
|
|
|
|
+template <typename Impl>
|
|
|
+template <typename B, typename V>
|
|
|
+template <typename T>
|
|
|
+Arguments<Impl>::WithDefault<B, V>::operator T() const {
|
|
|
+ if (impl) { return impl; }
|
|
|
+ if constexpr (std::is_invocable_r<T, V>{}) {
|
|
|
+ return T(default_value());
|
|
|
+ } else {
|
|
|
+ return T{default_value};
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+namespace program {
|
|
|
+
|
|
|
template <typename Impl>
|
|
|
Arguments<Impl>::Arguments(int argc, char const * const * const argv) {
|
|
|
Impl generator;
|