Skip to content

Commit

Permalink
MSVC throwing error on the legit shift.
Browse files Browse the repository at this point in the history
  • Loading branch information
obhi-d committed Oct 22, 2024
1 parent 027c73c commit 11b94fb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions include/acl/ecs/entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,19 @@ class basic_entity
static constexpr size_type nb_revision_bits = RevisionBits;
static constexpr size_type nb_usable_bits = (sizeof(size_type) * 8 - nb_revision_bits);
static constexpr size_type index_mask_v = std::numeric_limits<size_type>::max() >> nb_revision_bits;
static constexpr size_type revision_mask_v = std::numeric_limits<size_type>::max() << nb_usable_bits;
static constexpr size_type version_inc_v = 1 << nb_usable_bits;
static constexpr size_type revision_mask_v = []() -> size_type
{
if constexpr (nb_revision_bits > 0)
return std::numeric_limits<size_type>::max() << nb_usable_bits;
return 0;
}();
static constexpr size_type version_inc_v = []() -> size_type
{
constexpr size_type one = 1;
if constexpr (nb_revision_bits > 0)
return one << nb_usable_bits;
return 0;
}();

constexpr basic_entity() noexcept = default;
constexpr basic_entity(basic_entity const& i) noexcept = default;
Expand Down

0 comments on commit 11b94fb

Please sign in to comment.