1313
1414namespace esp_panel ::drivers {
1515
16- /* *
17- * @brief Concept to check whether a type is derived from `esp_expander::Base`
18- *
19- * @tparam T Type to be checked
20- */
21- template <class T >
22- concept CheckIsIO_ExpanderAdaptee = std::is_base_of_v<esp_expander::Base, T>;
2316
2417/* *
2518 * @brief Adapter class template for IO expander devices
2619 *
2720 * @tparam T Type of the IO expander device, must satisfy CheckIsIO_ExpanderAdaptee concept
2821 */
2922template <class T >
30- requires CheckIsIO_ExpanderAdaptee<T>
3123class IO_ExpanderAdapter : public IO_Expander , public T {
3224public:
25+ static_assert (std::is_base_of_v<esp_expander::Base, T>, " `T` must be derived from `esp_expander::Base`" );
26+
3327 /* *
3428 * @brief Construct a new IO expander adapter
3529 *
@@ -94,7 +88,6 @@ class IO_ExpanderAdapter: public IO_Expander, public T {
9488};
9589
9690template <class T >
97- requires CheckIsIO_ExpanderAdaptee<T>
9891IO_ExpanderAdapter<T>::~IO_ExpanderAdapter ()
9992{
10093 ESP_UTILS_LOG_TRACE_ENTER_WITH_THIS ();
@@ -105,7 +98,6 @@ IO_ExpanderAdapter<T>::~IO_ExpanderAdapter()
10598}
10699
107100template <class T >
108- requires CheckIsIO_ExpanderAdaptee<T>
109101bool IO_ExpanderAdapter<T>::init()
110102{
111103 ESP_UTILS_LOG_TRACE_ENTER_WITH_THIS ();
@@ -137,7 +129,6 @@ bool IO_ExpanderAdapter<T>::init()
137129}
138130
139131template <class T >
140- requires CheckIsIO_ExpanderAdaptee<T>
141132bool IO_ExpanderAdapter<T>::begin()
142133{
143134 ESP_UTILS_LOG_TRACE_ENTER_WITH_THIS ();
@@ -162,7 +153,6 @@ bool IO_ExpanderAdapter<T>::begin()
162153}
163154
164155template <class T >
165- requires CheckIsIO_ExpanderAdaptee<T>
166156bool IO_ExpanderAdapter<T>::del()
167157{
168158 ESP_UTILS_LOG_TRACE_ENTER_WITH_THIS ();
0 commit comments