Fix C++11 array compatibility in network_array.hpp
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 27 Dec 2025 16:14:25 +0000 (17:14 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 27 Dec 2025 16:18:12 +0000 (17:18 +0100)
Replace .elems[0] with .data() for address_v6::bytes_type (std::array)
which does not have the elems member. Keep .elems for boost::array.

lib/boost-net-dns/boost/net/network_array.hpp

index 198ada7..1c35ab1 100755 (executable)
@@ -367,7 +367,7 @@ public:
     }
 
     ip::address_v6::bytes_type  bytes;
-    memcpy( &bytes.elems[0], &data_array.elems[nap], 16);
+    memcpy( bytes.data(), &data_array.elems[nap], 16);
     d = ip::address_v6(bytes);
     if( incpos )
     {
@@ -393,7 +393,7 @@ public:
       position(p);
     }
 
-    memcpy( &data_array.elems[nap], &d.to_bytes().elems[0], 16);
+    memcpy( &data_array.elems[nap], d.to_bytes().data(), 16);
 
     if( incpos )
     {