1
0
Fork 0

shared pointer aliases require correct base class types

This commit is contained in:
Kevin Matz 2023-05-18 15:39:26 -04:00
parent 74815726bf
commit de346b15b4
1 changed files with 4 additions and 2 deletions

View File

@ -60,7 +60,8 @@ struct pdu_data : public streamable {};
* @tparam T PDU derived class
*/
template <class T>
using Message = std::shared_ptr<T>;
using Message = std::enable_if_t<std::is_base_of<Pdu, T>::value,
std::shared_ptr<T>>;
/**
@ -68,7 +69,8 @@ using Message = std::shared_ptr<T>;
* @tparam T PDU derived class
*/
template <class T>
using Handler = std::function<void(Message<T>)>;
using Handler = std::enable_if_t<std::is_base_of<Pdu, T>::value,
std::function<void(Message<T>)>>;
/**