Add #pragmas in ecs::accessor to silence false-positive dangling reference warning in GCC
This commit is contained in:
parent
d9935c7476
commit
933874eddf
1 changed files with 5 additions and 0 deletions
|
|
@ -93,6 +93,9 @@ namespace psemek::ecs
|
|||
return reinterpret_cast<Component *>(column->data() + detail::stride<Component>() * row_);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdangling-reference"
|
||||
|
||||
template <typename Component>
|
||||
Component & accessor::get()
|
||||
{
|
||||
|
|
@ -109,6 +112,8 @@ namespace psemek::ecs
|
|||
throw component_not_found_exception(typeid(std::remove_const_t<Component>), table_->entity_handles()[row_]);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
template <typename Component>
|
||||
bool accessor::contains() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue