From cd2b6be6e89246028579a98bb19c576efcff68ec Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 18 Mar 2022 11:40:31 +1000 Subject: [PATCH] cmdopt2/arg: add bind support to more string types --- cmdopt2/arg.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmdopt2/arg.hpp b/cmdopt2/arg.hpp index 12a9508d..3098b30c 100644 --- a/cmdopt2/arg.hpp +++ b/cmdopt2/arg.hpp @@ -8,9 +8,10 @@ #pragma once +#include +#include #include #include -#include #include #include @@ -38,7 +39,7 @@ namespace cruft::cmdopt2 { bind (ValueT &ref) { CHECK (!acceptor1); - if constexpr (std::is_same_v or std::is_same_v) { + if constexpr (cruft::concepts::stringy) { acceptor1 = [&ref] (std::string_view str) { ref = str; }; } else { acceptor1 = [&ref] (std::string_view str) { ref = parse::from_string (str); };