Skip to content

Commit

Permalink
Remove static_assert size check for pt_node
Browse files Browse the repository at this point in the history
The layout is fixed now anyway.
  • Loading branch information
foonathan committed Jan 7, 2025
1 parent 0bca2dd commit 0bce9a7
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions include/lexy/parse_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,12 @@ struct pt_node_token : pt_node<Reader>
{
if constexpr (_optimize_end)
{
static_assert(!std::is_pointer_v<typename Reader::iterator>
|| sizeof(pt_node_token) == 3 * sizeof(void*));

auto size = std::size_t(end - begin);
LEXY_PRECONDITION(size <= UINT_LEAST32_MAX);
end_impl = std::uint_least32_t(size);
}
else
{
static_assert(!std::is_pointer_v<typename Reader::iterator>
|| sizeof(pt_node_token) <= 4 * sizeof(void*));

end_impl = end;
}
}
Expand All @@ -162,7 +156,6 @@ struct pt_node_production : pt_node<Reader>
: pt_node<Reader>(pt_node<Reader>::type_production), id(info.id), child_count(0),
token_production(info.is_token), first_child_adjacent(true)
{
static_assert(sizeof(pt_node_production) == 3 * sizeof(void*));
LEXY_PRECONDITION(!info.is_transparent);
}

Expand Down

0 comments on commit 0bce9a7

Please sign in to comment.