Skip to content
Snippets Groups Projects
Commit 8d4a8ae3 authored by Benny Baumann's avatar Benny Baumann
Browse files

add: Implement implicit conversion assignment

parent deb5c4ee
No related branches found
No related tags found
1 merge request!1First unit tests
......@@ -74,6 +74,14 @@ public:
len = sizeof(T);
}
explicit socketaddr(const sockaddr_storage *other) : addr{}, len{} {
*this = other;
}
explicit socketaddr(const sockaddr_storage &other) : addr{}, len{} {
*this = &other;
}
template <typename T, typename std::enable_if<has_field<T>::value, T>::type * = nullptr>
explicit socketaddr(const T& other) : addr{}, len{} {
if (other.*(family_map<T>::sa_family_field) != family_map<T>::sa_family) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment