Просмотр исходного кода

entity: remove asserts from to_entity, it's potentially UB as from the standard

Michele Caini 5 лет назад
Родитель
Сommit
46f6f41a6b
1 измененных файлов с 0 добавлено и 2 удалено
  1. 0 2
      src/entt/entity/helper.hpp

+ 0 - 2
src/entt/entity/helper.hpp

@@ -139,8 +139,6 @@ void invoke(basic_registry<Entity> &reg, const Entity entt) {
  */
 template<typename Entity, typename Component>
 Entity to_entity(const basic_registry<Entity> &reg, const Component &component) {
-    ENTT_ASSERT(!(reg.template raw<Component>() > &component));
-    ENTT_ASSERT(&component < (reg.template raw<Component>() + reg.template size<Component>()));
     return *(reg.template data<Component>() + (&component - reg.template raw<Component>()));
 }