Skip to content

Commit

Permalink
Merge #29983: msvc: Compile test\fuzz\bitdeque.cpp
Browse files Browse the repository at this point in the history
774359b build, msvc: Compile `test\fuzz\bitdeque.cpp` (Hennadii Stepanov)
85f50a4 refactor: Fix "error C2248: cannot access private member" on MSVC (Hennadii Stepanov)

Pull request description:

  This PR resolves one point from the #29774 (comment):
  > What is the issue with the bitdeque... ?

ACKs for top commit:
  maflcko:
    lgtm ACK 774359b
  sipa:
    utACK 774359b
  achow101:
    ACK 774359b
  dergoegge:
    utACK 774359b

Tree-SHA512: dba5c0217b915468af08475795437a10d8e8dedfadeb319f36d9b1bf54a91a8b2c61470a6047565855276c2bc8589c7776dc19237610b65b57cc841a303de8b3
  • Loading branch information
achow101 committed May 1, 2024
2 parents 063072b + 774359b commit 4df2d0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build_msvc/fuzz/fuzz.vcxproj
Expand Up @@ -9,8 +9,8 @@
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemGroup>
<!-- TODO: Fix the code and remove bitdeque.cpp and miniscript.cpp exclusion. -->
<ClCompile Include="..\..\src\test\fuzz\*.cpp" Exclude="..\..\src\test\fuzz\bitdeque.cpp;..\..\src\test\fuzz\miniscript.cpp" />
<!-- TODO: Fix the code and remove miniscript.cpp exclusion. -->
<ClCompile Include="..\..\src\test\fuzz\*.cpp" Exclude="..\..\src\test\fuzz\miniscript.cpp" />
<ClCompile Include="..\..\src\test\fuzz\util\descriptor.cpp">
<ObjectFileName>$(IntDir)test_fuzz_util_descriptor.obj</ObjectFileName>
</ClCompile>
Expand Down
9 changes: 4 additions & 5 deletions src/util/bitdeque.h
Expand Up @@ -14,18 +14,17 @@

/** Class that mimics std::deque<bool>, but with std::vector<bool>'s bit packing.
*
* BlobSize selects the (minimum) number of bits that are allocated at once.
* BITS_PER_WORD selects the (minimum) number of bits that are allocated at once.
* Larger values reduce the asymptotic memory usage overhead, at the cost of
* needing larger up-front allocations. The default is 4096 bytes.
*/
template<int BlobSize = 4096 * 8>
template<int BITS_PER_WORD = 4096 * 8>
class bitdeque
{
// Internal definitions
using word_type = std::bitset<BlobSize>;
using word_type = std::bitset<BITS_PER_WORD>;
using deque_type = std::deque<word_type>;
static_assert(BlobSize > 0);
static constexpr int BITS_PER_WORD = BlobSize;
static_assert(BITS_PER_WORD > 0);

// Forward and friend declarations of iterator types.
template<bool Const> class Iterator;
Expand Down

0 comments on commit 4df2d0c

Please sign in to comment.