Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Horrid double braces for std::array
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 8 Mar 2016 09:02:20 +0000 (10:02 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 8 Mar 2016 09:03:30 +0000 (10:03 +0100)
This is needed in C++11 (not in C++14).

src/mc/mc_dwarf.cpp

index a8f58bb..7a754a4 100644 (file)
@@ -1065,7 +1065,9 @@ static char hexdigits[16] = {
 static inline
 std::array<char, 2> to_hex(std::uint8_t byte)
 {
-  return { hexdigits[byte >> 4], hexdigits[byte & 0xF] };
+  // Horrid double braces!
+  // Apparently, this is needed in C++11 (not in C++14).
+  return { { hexdigits[byte >> 4], hexdigits[byte & 0xF] } };
 }
 
 /** Binary data to hexadecimal */