Skip to content

Commit

Permalink
drivertools: fix C++20 "incomplete type" error by moving constructors…
Browse files Browse the repository at this point in the history
… below other definitions
  • Loading branch information
aiju committed Aug 22, 2024
1 parent f456761 commit 9b5e81b
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions kernel/drivertools.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,8 @@ struct DriveBitMultiple
pool<DriveBit> multiple_;

public:
DriveBitMultiple() {}
DriveBitMultiple(DriveBit const &single)
{
multiple_.emplace(single);
}
DriveBitMultiple();
DriveBitMultiple(DriveBit const &single);

pool<DriveBit> const &multiple() const { return multiple_; }

Expand Down Expand Up @@ -467,6 +464,11 @@ struct DriveBit

};

inline DriveBitMultiple::DriveBitMultiple() {}
inline DriveBitMultiple::DriveBitMultiple(DriveBit const &single)
{
multiple_.emplace(single);
}

struct DriveChunkWire
{
Expand Down Expand Up @@ -626,10 +628,7 @@ struct DriveChunkMultiple
public:
pool<DriveChunk> 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_; }

Expand Down Expand Up @@ -1030,6 +1029,13 @@ struct DriveChunk
}
};

inline DriveChunkMultiple::DriveChunkMultiple(DriveBitMultiple const &bit)
: width_(1)
{
for (auto const &bit : bit.multiple())
multiple_.emplace(bit);
}

struct DriveSpec
{
private:
Expand Down

0 comments on commit 9b5e81b

Please sign in to comment.