2929#include < sdbus-c++/Error.h>
3030#include < sdbus-c++/TypeTraits.h>
3131
32+ #include < concepts>
3233#include < string>
3334#include < type_traits>
3435#include < vector>
@@ -81,11 +82,9 @@ namespace sdbus {
8182 return std::move (*this );
8283 }
8384
84- template <typename ... String>
85+ template <std::convertible_to<std::string> ... String>
8586 inline MethodVTableItem&& MethodVTableItem::withInputParamNames(String... names) &&
8687 {
87- static_assert (std::conjunction_v<std::is_convertible<String, std::string>...>, " Parameter names must be (convertible to) strings" );
88-
8988 return std::move (*this ).withInputParamNames ({names...});
9089 }
9190
@@ -96,11 +95,9 @@ namespace sdbus {
9695 return std::move (*this );
9796 }
9897
99- template <typename ... String>
98+ template <std::convertible_to<std::string> ... String>
10099 inline MethodVTableItem&& MethodVTableItem::withOutputParamNames(String... names) &&
101100 {
102- static_assert (std::conjunction_v<std::is_convertible<String, std::string>...>, " Parameter names must be (convertible to) strings" );
103-
104101 return std::move (*this ).withOutputParamNames ({names...});
105102 }
106103
@@ -155,12 +152,10 @@ namespace sdbus {
155152 return std::move (*this ).template withParameters <Args...>();
156153 }
157154
158- template <typename ... Args, typename ... String>
155+ template <typename ... Args, std::convertible_to<std::string>... String>
156+ requires (sizeof ...(Args) == sizeof ...(String))
159157 inline SignalVTableItem&& SignalVTableItem::withParameters(String... names) &&
160158 {
161- static_assert (std::conjunction_v<std::is_convertible<String, std::string>...>, " Parameter names must be (convertible to) strings" );
162- static_assert (sizeof ...(Args) == sizeof ...(String), " Numbers of signal parameters and their names don't match" );
163-
164159 return std::move (*this ).template withParameters <Args...>({names...});
165160 }
166161
0 commit comments