Skip to content

Commit

Permalink
"... casts away constness..." blah blah blah
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-plusplus committed Oct 11, 2024
1 parent ee40ae4 commit b8a0b3c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/ecs/View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ auto VIEW_ECIE::getAsTuple(const E entity) noexcept requires(!Const)
constexpr auto idx = Include::template find<C>;

if constexpr (_details::ComponentTraits<C, E>::flag) {
return std::make_tuple(dynamic_cast<CPoolPtr<C>>(_includedCPools[idx])->get(entity));
return std::make_tuple(
dynamic_cast<CPoolPtr<C>>(
const_cast<std::conditional_t<std::is_const_v<C>, CCPoolPtr, _details::CommonComponentPool<E>*>>(
_includedCPools[idx]
)
)
->get(entity)
);
} else {
return std::tie(
dynamic_cast<CPoolPtr<C>>(
Expand Down

0 comments on commit b8a0b3c

Please sign in to comment.