Skip to content

Commit

Permalink
Use static assert for sizeof check
Browse files Browse the repository at this point in the history
  • Loading branch information
Geod24 committed Feb 9, 2024
1 parent a978f57 commit 1721212
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/stdcpp/test/list.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import stdcpp.list;

unittest
{
version (CppRuntime_Microsoft)
static assert(list!int.sizeof == 16);
else
static assert(list!int.sizeof == 24);

auto p = list!int(5);
p.push_back(5);
assert(p.sizeof == 24);
assert(p.size() == 6);
assert(p.front() == 0);
assert(p.back() == 5);
Expand Down

0 comments on commit 1721212

Please sign in to comment.