From 9b5e81b13fbc2e4947ad591bd49971a278082247 Mon Sep 17 00:00:00 2001 From: Emily Schmidt Date: Thu, 22 Aug 2024 10:40:56 +0100 Subject: [PATCH] drivertools: fix C++20 "incomplete type" error by moving constructors below other definitions --- kernel/drivertools.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/kernel/drivertools.h b/kernel/drivertools.h index 8a51b88d9..079701c35 100644 --- a/kernel/drivertools.h +++ b/kernel/drivertools.h @@ -146,11 +146,8 @@ private: pool multiple_; public: - DriveBitMultiple() {} - DriveBitMultiple(DriveBit const &single) - { - multiple_.emplace(single); - } + DriveBitMultiple(); + DriveBitMultiple(DriveBit const &single); pool const &multiple() const { return multiple_; } @@ -467,6 +464,11 @@ public: }; +inline DriveBitMultiple::DriveBitMultiple() {} +inline DriveBitMultiple::DriveBitMultiple(DriveBit const &single) +{ + multiple_.emplace(single); +} struct DriveChunkWire { @@ -626,10 +628,7 @@ private: public: pool const &multiple() const { return multiple_; } - DriveChunkMultiple(DriveBitMultiple const &bit) : width_(1) { - for (auto const &bit : bit.multiple()) - multiple_.emplace(bit); - } + DriveChunkMultiple(DriveBitMultiple const &bit); int size() const { return width_; } @@ -1030,6 +1029,13 @@ public: } }; +inline DriveChunkMultiple::DriveChunkMultiple(DriveBitMultiple const &bit) + : width_(1) +{ + for (auto const &bit : bit.multiple()) + multiple_.emplace(bit); +} + struct DriveSpec { private: