]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix(protozero): Keep the SpanID and TraceID ctors `constexpr` 16425/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 12 Nov 2025 09:21:05 +0000 (10:21 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 12 Nov 2025 09:21:05 +0000 (10:21 +0100)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/protozero-trace.hh

index 1b2fc2b9feda3cfe2073012b3802fcaf99d33b3d..31c48d1a3b22fe6268c3de4046b550b3ca8157cb 100644 (file)
@@ -231,7 +231,7 @@ struct InstrumentationScope
 
 struct TraceID : public std::array<uint8_t, 16>
 {
-  TraceID() :
+  constexpr TraceID() :
     array{} {};
   TraceID(const std::initializer_list<uint8_t>& arg) :
     array{}
@@ -262,11 +262,11 @@ struct TraceID : public std::array<uint8_t, 16>
     this->fill(0);
   }
 };
-const TraceID s_emptyTraceID = {};
+constexpr TraceID s_emptyTraceID = {};
 
 struct SpanID : public std::array<uint8_t, 8>
 {
-  SpanID() :
+  constexpr SpanID() :
     array{} {};
   SpanID(const std::initializer_list<uint8_t>& arg) :
     array{}
@@ -297,7 +297,7 @@ struct SpanID : public std::array<uint8_t, 8>
     this->fill(0);
   }
 };
-const SpanID s_emptySpanID = {};
+constexpr SpanID s_emptySpanID = {};
 
 inline void fill(TraceID& trace, const std::string& data)
 {