From b0f0e11942618eadedd8995cbc91032cfe92fe77 Mon Sep 17 00:00:00 2001 From: Dan Foreman-Mackey Date: Sat, 22 Nov 2025 13:01:03 -0500 Subject: [PATCH] Update custom numeric data types to use default constructor. --- tensorstore/util/bfloat16.h | 5 +---- tensorstore/util/float8.h | 3 +-- tensorstore/util/int2.h | 5 +---- tensorstore/util/int4.h | 5 +---- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/tensorstore/util/bfloat16.h b/tensorstore/util/bfloat16.h index 7ade462ca..881ee6079 100644 --- a/tensorstore/util/bfloat16.h +++ b/tensorstore/util/bfloat16.h @@ -79,10 +79,7 @@ float Bfloat16ToFloat(BFloat16 v); /// \ingroup Data types class BFloat16 { public: - /// Zero initialization. - /// - /// \id zero - constexpr BFloat16() : rep_(0) {} + BFloat16() = default; /// Possibly lossy conversion from any type convertible to `float`. /// diff --git a/tensorstore/util/float8.h b/tensorstore/util/float8.h index 4e9630a65..c630b8356 100644 --- a/tensorstore/util/float8.h +++ b/tensorstore/util/float8.h @@ -85,8 +85,7 @@ class Float8Base { public: static constexpr int kBits = 8; - - constexpr Float8Base() : rep_(0) {} + Float8Base() = default; template explicit Float8Base(T i, diff --git a/tensorstore/util/int2.h b/tensorstore/util/int2.h index 30ba3f8ac..c0e3d848a 100644 --- a/tensorstore/util/int2.h +++ b/tensorstore/util/int2.h @@ -48,10 +48,7 @@ constexpr int8_t SignedTrunc2(int8_t x) { /// \ingroup Data types class Int2Padded { public: - /// Zero initialization. - /// - /// \id zero - constexpr Int2Padded() : rep_(0) {} + Int2Padded() = default; /// Possibly lossy conversion from any type convertible to `int8_t`. /// diff --git a/tensorstore/util/int4.h b/tensorstore/util/int4.h index 6c9f4c792..b89e1a0fa 100644 --- a/tensorstore/util/int4.h +++ b/tensorstore/util/int4.h @@ -49,10 +49,7 @@ constexpr int8_t SignedTrunc4(int8_t x) { /// \ingroup Data types class Int4Padded { public: - /// Zero initialization. - /// - /// \id zero - constexpr Int4Padded() : rep_(0) {} + Int4Padded() = default; /// Possibly lossy conversion from any type convertible to `int8_t`. ///