net/ether: Fixup constructors
We need the ability to construct from other `ether_addr` objects and
direct initializer lists.
Change-Id: I70dc1d8efd519a089f35b5b2da3c56a70cc67089
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/include/stdplus/net/addr/ether.hpp b/include/stdplus/net/addr/ether.hpp
index 91cf031..a2cc377 100644
--- a/include/stdplus/net/addr/ether.hpp
+++ b/include/stdplus/net/addr/ether.hpp
@@ -11,6 +11,14 @@
struct EtherAddr : ether_addr
{
+ constexpr EtherAddr() noexcept : ether_addr() {}
+ constexpr EtherAddr(ether_addr other) noexcept : ether_addr(other) {}
+ explicit constexpr EtherAddr(std::initializer_list<uint8_t> a) noexcept :
+ ether_addr()
+ {
+ std::copy(a.begin(), a.end(), ether_addr_octet);
+ }
+
constexpr bool operator==(ether_addr rhs) const noexcept
{
return std::equal(ether_addr_octet, ether_addr_octet + 6,