introduced ENTT_DISABLE_ASSERT/ENTT_ASSERT macros
This commit is contained in:
@@ -12,19 +12,14 @@
|
||||
#endif // ENTT_HS_SUFFIX
|
||||
|
||||
|
||||
#ifndef ENTT_TAG_SUFFIX
|
||||
#define ENTT_TAG_SUFFIX _tag
|
||||
#endif // ENTT_TAG_SUFFIX
|
||||
|
||||
|
||||
#ifndef ENTT_NO_ATOMIC
|
||||
#include <atomic>
|
||||
template<typename Type>
|
||||
using maybe_atomic_t = std::atomic<Type>;
|
||||
#else // ENTT_USE_ATOMIC
|
||||
#else // ENTT_NO_ATOMIC
|
||||
template<typename Type>
|
||||
using maybe_atomic_t = Type;
|
||||
#endif // ENTT_USE_ATOMIC
|
||||
#endif // ENTT_NO_ATOMIC
|
||||
|
||||
|
||||
#ifndef ENTT_ID_TYPE
|
||||
@@ -33,15 +28,17 @@ using maybe_atomic_t = Type;
|
||||
#endif // ENTT_ID_TYPE
|
||||
|
||||
|
||||
#ifndef ENTT_ENTITY_TYPE
|
||||
#include <cstdint>
|
||||
#define ENTT_ENTITY_TYPE std::uint32_t
|
||||
#endif // ENTT_ENTITY_TYPE
|
||||
|
||||
|
||||
#ifndef ENTT_PAGE_SIZE
|
||||
#define ENTT_PAGE_SIZE 32768
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef ENTT_DISABLE_ASSERT
|
||||
#include <cassert>
|
||||
#define ENTT_ASSERT(condition) assert(condition)
|
||||
#else // ENTT_DISABLE_ASSERT
|
||||
#define ENTT_ASSERT(...) ((void)0)
|
||||
#endif // ENTT_DISABLE_ASSERT
|
||||
|
||||
|
||||
#endif // ENTT_CONFIG_CONFIG_H
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define ENTT_ENTITY_FWD_HPP
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
#include "../config/config.h"
|
||||
|
||||
|
||||
@@ -44,7 +45,7 @@ template<typename>
|
||||
class basic_continuous_loader;
|
||||
|
||||
/*! @brief Alias declaration for the most common use case. */
|
||||
using entity = ENTT_ENTITY_TYPE;
|
||||
using entity = std::uint32_t;
|
||||
|
||||
/*! @brief Alias declaration for the most common use case. */
|
||||
using registry = basic_registry<entity>;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define ENTT_ENTITY_GROUP_HPP
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
@@ -284,7 +283,7 @@ public:
|
||||
template<typename... Component>
|
||||
std::conditional_t<sizeof...(Component) == 1, std::tuple_element_t<0, std::tuple<Component &...>>, std::tuple<Component &...>>
|
||||
get([[maybe_unused]] const entity_type entt) const ENTT_NOEXCEPT {
|
||||
assert(contains(entt));
|
||||
ENTT_ASSERT(contains(entt));
|
||||
|
||||
if constexpr(sizeof...(Component) == 1) {
|
||||
return (std::get<pool_type<Component> *>(pools)->get(entt), ...);
|
||||
@@ -606,7 +605,7 @@ public:
|
||||
template<typename... Component>
|
||||
std::conditional_t<sizeof...(Component) == 1, std::tuple_element_t<0, std::tuple<Component &...>>, std::tuple<Component &...>>
|
||||
get([[maybe_unused]] const entity_type entt) const ENTT_NOEXCEPT {
|
||||
assert(contains(entt));
|
||||
ENTT_ASSERT(contains(entt));
|
||||
|
||||
if constexpr(sizeof...(Component) == 1) {
|
||||
return (std::get<pool_type<Component> *>(pools)->get(entt), ...);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <cstddef>
|
||||
#include <cassert>
|
||||
#include <numeric>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
@@ -485,7 +484,7 @@ public:
|
||||
*/
|
||||
version_type current(const entity_type entity) const ENTT_NOEXCEPT {
|
||||
const auto pos = size_type(entity & traits_type::entity_mask);
|
||||
assert(pos < entities.size());
|
||||
ENTT_ASSERT(pos < entities.size());
|
||||
return version_type(entities[pos] >> traits_type::entity_shift);
|
||||
}
|
||||
|
||||
@@ -526,7 +525,7 @@ public:
|
||||
} else {
|
||||
entity = entities.emplace_back(entity_type(entities.size()));
|
||||
// traits_type::entity_mask is reserved to allow for null identifiers
|
||||
assert(entity < traits_type::entity_mask);
|
||||
ENTT_ASSERT(entity < traits_type::entity_mask);
|
||||
}
|
||||
|
||||
if constexpr(sizeof...(Component) == 0) {
|
||||
@@ -617,7 +616,7 @@ public:
|
||||
* @param entity A valid entity identifier.
|
||||
*/
|
||||
void destroy(const entity_type entity) {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
|
||||
for(auto pos = pools.size(); pos; --pos) {
|
||||
auto &pdata = pools[pos-1];
|
||||
@@ -628,7 +627,7 @@ public:
|
||||
};
|
||||
|
||||
// just a way to protect users from listeners that attach components
|
||||
assert(orphan(entity));
|
||||
ENTT_ASSERT(orphan(entity));
|
||||
release(entity);
|
||||
}
|
||||
|
||||
@@ -640,7 +639,7 @@ public:
|
||||
*/
|
||||
template<typename It>
|
||||
void destroy(It first, It last) {
|
||||
assert(std::all_of(first, last, [this](const auto entity) { return valid(entity); }));
|
||||
ENTT_ASSERT(std::all_of(first, last, [this](const auto entity) { return valid(entity); }));
|
||||
|
||||
for(auto pos = pools.size(); pos; --pos) {
|
||||
auto &pdata = pools[pos-1];
|
||||
@@ -655,7 +654,7 @@ public:
|
||||
};
|
||||
|
||||
// just a way to protect users from listeners that attach components
|
||||
assert(std::all_of(first, last, [this](const auto entity) { return orphan(entity); }));
|
||||
ENTT_ASSERT(std::all_of(first, last, [this](const auto entity) { return orphan(entity); }));
|
||||
|
||||
std::for_each(first, last, [this](const auto entity) {
|
||||
release(entity);
|
||||
@@ -684,7 +683,7 @@ public:
|
||||
*/
|
||||
template<typename Component, typename... Args>
|
||||
Component & assign(const entity_type entity, Args &&... args) {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
return assure<Component>()->construct(entity, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
@@ -703,7 +702,7 @@ public:
|
||||
*/
|
||||
template<typename Component>
|
||||
void remove(const entity_type entity) {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
pool<Component>()->destroy(entity);
|
||||
}
|
||||
|
||||
@@ -721,7 +720,7 @@ public:
|
||||
*/
|
||||
template<typename... Component>
|
||||
bool has(const entity_type entity) const ENTT_NOEXCEPT {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
[[maybe_unused]] const auto cpools = std::make_tuple(pool<Component>()...);
|
||||
return ((std::get<const pool_type<Component> *>(cpools)
|
||||
? std::get<const pool_type<Component> *>(cpools)->has(entity)
|
||||
@@ -744,7 +743,7 @@ public:
|
||||
*/
|
||||
template<typename... Component>
|
||||
decltype(auto) get([[maybe_unused]] const entity_type entity) const ENTT_NOEXCEPT {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
|
||||
if constexpr(sizeof...(Component) == 1) {
|
||||
return (pool<Component>()->get(entity), ...);
|
||||
@@ -789,7 +788,7 @@ public:
|
||||
*/
|
||||
template<typename Component, typename... Args>
|
||||
Component & get_or_assign(const entity_type entity, Args &&... args) ENTT_NOEXCEPT {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
auto *cpool = assure<Component>();
|
||||
auto *comp = cpool->try_get(entity);
|
||||
return comp ? *comp : cpool->construct(entity, std::forward<Args>(args)...);
|
||||
@@ -809,7 +808,7 @@ public:
|
||||
*/
|
||||
template<typename... Component>
|
||||
auto try_get([[maybe_unused]] const entity_type entity) const ENTT_NOEXCEPT {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
|
||||
if constexpr(sizeof...(Component) == 1) {
|
||||
const auto cpools = std::make_tuple(pool<Component>()...);
|
||||
@@ -1002,7 +1001,7 @@ public:
|
||||
*/
|
||||
template<typename Component, typename Compare, typename Sort = std_sort, typename... Args>
|
||||
void sort(Compare compare, Sort sort = Sort{}, Args &&... args) {
|
||||
assert(!owned<Component>());
|
||||
ENTT_ASSERT(!owned<Component>());
|
||||
assure<Component>()->sort(std::move(compare), std::move(sort), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
@@ -1045,7 +1044,7 @@ public:
|
||||
*/
|
||||
template<typename To, typename From>
|
||||
void sort() {
|
||||
assert(!owned<To>());
|
||||
ENTT_ASSERT(!owned<To>());
|
||||
assure<To>()->respect(*assure<From>());
|
||||
}
|
||||
|
||||
@@ -1065,7 +1064,7 @@ public:
|
||||
*/
|
||||
template<typename Component>
|
||||
void reset(const entity_type entity) {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
auto *cpool = assure<Component>();
|
||||
|
||||
if(cpool->has(entity)) {
|
||||
@@ -1162,7 +1161,7 @@ public:
|
||||
* @return True if the entity is an orphan, false otherwise.
|
||||
*/
|
||||
bool orphan(const entity_type entity) const {
|
||||
assert(valid(entity));
|
||||
ENTT_ASSERT(valid(entity));
|
||||
bool orphan = true;
|
||||
|
||||
for(std::size_t i = {}; i < pools.size() && orphan; ++i) {
|
||||
@@ -1331,7 +1330,7 @@ public:
|
||||
});
|
||||
|
||||
if(it == inner_groups.cend()) {
|
||||
assert(!(owned<Owned>() || ...));
|
||||
ENTT_ASSERT(!(owned<Owned>() || ...));
|
||||
using group_type = owning_group<type_list<std::decay_t<Exclude>...>, type_list<std::decay_t<Get>...>, std::decay_t<Owned>...>;
|
||||
auto &gdata = inner_groups.emplace_back();
|
||||
|
||||
@@ -1466,7 +1465,7 @@ public:
|
||||
auto &curr = other.pools[pos-1];
|
||||
curr.pool = pdata.pool->clone();
|
||||
curr.runtime_type = pdata.runtime_type;
|
||||
assert(curr.pool);
|
||||
ENTT_ASSERT(curr.pool);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1657,7 +1656,7 @@ public:
|
||||
template<typename Type>
|
||||
const Type & ctx() const ENTT_NOEXCEPT {
|
||||
const auto *instance = try_ctx<Type>();
|
||||
assert(instance);
|
||||
ENTT_ASSERT(instance);
|
||||
return *instance;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
@@ -198,7 +197,7 @@ class basic_snapshot_loader {
|
||||
force{fn}
|
||||
{
|
||||
// to restore a snapshot as a whole requires a clean registry
|
||||
assert(!reg.capacity());
|
||||
ENTT_ASSERT(!reg.capacity());
|
||||
}
|
||||
|
||||
template<typename Archive>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <cstddef>
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
#include "../config/config.h"
|
||||
#include "../core/algorithm.hpp"
|
||||
@@ -376,7 +375,7 @@ public:
|
||||
* @return The position of the entity in the sparse set.
|
||||
*/
|
||||
size_type get(const entity_type entt) const ENTT_NOEXCEPT {
|
||||
assert(has(entt));
|
||||
ENTT_ASSERT(has(entt));
|
||||
auto [page, offset] = index(entt);
|
||||
return size_type(reverse[page][offset]);
|
||||
}
|
||||
@@ -393,7 +392,7 @@ public:
|
||||
* @param entt A valid entity identifier.
|
||||
*/
|
||||
void construct(const entity_type entt) {
|
||||
assert(!has(entt));
|
||||
ENTT_ASSERT(!has(entt));
|
||||
auto [page, offset] = index(entt);
|
||||
assure(page);
|
||||
reverse[page][offset] = entity_type(direct.size());
|
||||
@@ -416,7 +415,7 @@ public:
|
||||
template<typename It>
|
||||
void batch(It first, It last) {
|
||||
std::for_each(first, last, [next = entity_type(direct.size()), this](const auto entt) mutable {
|
||||
assert(!has(entt));
|
||||
ENTT_ASSERT(!has(entt));
|
||||
auto [page, offset] = index(entt);
|
||||
assure(page);
|
||||
reverse[page][offset] = next++;
|
||||
@@ -437,7 +436,7 @@ public:
|
||||
* @param entt A valid entity identifier.
|
||||
*/
|
||||
virtual void destroy(const entity_type entt) {
|
||||
assert(has(entt));
|
||||
ENTT_ASSERT(has(entt));
|
||||
auto [from_page, from_offset] = index(entt);
|
||||
auto [to_page, to_offset] = index(direct.back());
|
||||
std::swap(direct[size_type(reverse[from_page][from_offset])], direct.back());
|
||||
@@ -462,8 +461,8 @@ public:
|
||||
* @param rhs A valid position within the sparse set.
|
||||
*/
|
||||
void swap(const size_type lhs, const size_type rhs) ENTT_NOEXCEPT {
|
||||
assert(lhs < direct.size());
|
||||
assert(rhs < direct.size());
|
||||
ENTT_ASSERT(lhs < direct.size());
|
||||
ENTT_ASSERT(rhs < direct.size());
|
||||
auto [src_page, src_offset] = index(direct[lhs]);
|
||||
auto [dst_page, dst_offset] = index(direct[rhs]);
|
||||
std::swap(reverse[src_page][src_offset], reverse[dst_page][dst_offset]);
|
||||
@@ -906,7 +905,7 @@ public:
|
||||
*/
|
||||
const object_type & get([[maybe_unused]] const entity_type entt) const ENTT_NOEXCEPT {
|
||||
if constexpr(std::is_empty_v<object_type>) {
|
||||
assert(underlying_type::has(entt));
|
||||
ENTT_ASSERT(underlying_type::has(entt));
|
||||
return instances;
|
||||
} else {
|
||||
return instances[underlying_type::get(entt)];
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
|
||||
#include <iterator>
|
||||
#include <cassert>
|
||||
#include <array>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
@@ -347,7 +346,7 @@ public:
|
||||
template<typename... Comp>
|
||||
std::conditional_t<sizeof...(Comp) == 1, std::tuple_element_t<0, std::tuple<Comp &...>>, std::tuple<Comp &...>>
|
||||
get([[maybe_unused]] const entity_type entt) const ENTT_NOEXCEPT {
|
||||
assert(contains(entt));
|
||||
ENTT_ASSERT(contains(entt));
|
||||
|
||||
if constexpr(sizeof...(Comp) == 1) {
|
||||
return (std::get<pool_type<Comp> *>(pools)->get(entt), ...);
|
||||
@@ -603,7 +602,7 @@ public:
|
||||
* @return The component assigned to the entity.
|
||||
*/
|
||||
raw_type & get(const entity_type entt) const ENTT_NOEXCEPT {
|
||||
assert(contains(entt));
|
||||
ENTT_ASSERT(contains(entt));
|
||||
return pool->get(entt);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
#include "../config/config.h"
|
||||
|
||||
|
||||
@@ -88,7 +87,7 @@ struct service_locator {
|
||||
* @param ptr Service to use to replace the current one.
|
||||
*/
|
||||
inline static void set(std::shared_ptr<Service> ptr) {
|
||||
assert(static_cast<bool>(ptr));
|
||||
ENTT_ASSERT(static_cast<bool>(ptr));
|
||||
service = std::move(ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define ENTT_META_FACTORY_HPP
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
@@ -81,7 +80,7 @@ class meta_factory {
|
||||
}
|
||||
};
|
||||
|
||||
assert(!duplicate(meta_any{std::get<0>(prop)}, node.next));
|
||||
ENTT_ASSERT(!duplicate(meta_any{std::get<0>(prop)}, node.next));
|
||||
return &node;
|
||||
}
|
||||
|
||||
@@ -110,8 +109,8 @@ class meta_factory {
|
||||
}
|
||||
};
|
||||
|
||||
assert(!duplicate(name, node.next));
|
||||
assert(!internal::meta_info<Type>::type);
|
||||
ENTT_ASSERT(!duplicate(name, node.next));
|
||||
ENTT_ASSERT(!internal::meta_info<Type>::type);
|
||||
internal::meta_info<Type>::type = &node;
|
||||
internal::meta_info<>::type = &node;
|
||||
|
||||
@@ -146,7 +145,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert((!internal::meta_info<Type>::template base<Base>));
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template base<Base>));
|
||||
internal::meta_info<Type>::template base<Base> = &node;
|
||||
type->base = &node;
|
||||
|
||||
@@ -179,7 +178,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert((!internal::meta_info<Type>::template conv<To>));
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template conv<To>));
|
||||
internal::meta_info<Type>::template conv<To> = &node;
|
||||
type->conv = &node;
|
||||
|
||||
@@ -220,7 +219,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert((!internal::meta_info<Type>::template ctor<typename helper_type::args_type>));
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template ctor<typename helper_type::args_type>));
|
||||
internal::meta_info<Type>::template ctor<typename helper_type::args_type> = &node;
|
||||
type->ctor = &node;
|
||||
|
||||
@@ -258,7 +257,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert((!internal::meta_info<Type>::template ctor<typename helper_type::args_type>));
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template ctor<typename helper_type::args_type>));
|
||||
internal::meta_info<Type>::template ctor<typename helper_type::args_type> = &node;
|
||||
type->ctor = &node;
|
||||
|
||||
@@ -298,8 +297,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert(!internal::meta_info<Type>::type->dtor);
|
||||
assert((!internal::meta_info<Type>::template dtor<Func>));
|
||||
ENTT_ASSERT(!internal::meta_info<Type>::type->dtor);
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template dtor<Func>));
|
||||
internal::meta_info<Type>::template dtor<Func> = &node;
|
||||
internal::meta_info<Type>::type->dtor = &node;
|
||||
|
||||
@@ -342,8 +341,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert(!duplicate(hashed_string{str}, node.next));
|
||||
assert((!internal::meta_info<Type>::template data<Data>));
|
||||
ENTT_ASSERT(!duplicate(hashed_string{str}, node.next));
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template data<Data>));
|
||||
internal::meta_info<Type>::template data<Data> = &node;
|
||||
type->data = &node;
|
||||
} else {
|
||||
@@ -364,8 +363,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert(!duplicate(hashed_string{str}, node.next));
|
||||
assert((!internal::meta_info<Type>::template data<Data>));
|
||||
ENTT_ASSERT(!duplicate(hashed_string{str}, node.next));
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template data<Data>));
|
||||
internal::meta_info<Type>::template data<Data> = &node;
|
||||
type->data = &node;
|
||||
}
|
||||
@@ -416,8 +415,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert(!duplicate(hashed_string{str}, node.next));
|
||||
assert((!internal::meta_info<Type>::template data<Setter, Getter>));
|
||||
ENTT_ASSERT(!duplicate(hashed_string{str}, node.next));
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template data<Setter, Getter>));
|
||||
internal::meta_info<Type>::template data<Setter, Getter> = &node;
|
||||
type->data = &node;
|
||||
|
||||
@@ -461,8 +460,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
assert(!duplicate(hashed_string{str}, node.next));
|
||||
assert((!internal::meta_info<Type>::template func<Func>));
|
||||
ENTT_ASSERT(!duplicate(hashed_string{str}, node.next));
|
||||
ENTT_ASSERT((!internal::meta_info<Type>::template func<Func>));
|
||||
internal::meta_info<Type>::template func<Func> = &node;
|
||||
type->func = &node;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
#include <functional>
|
||||
@@ -489,7 +488,7 @@ public:
|
||||
*/
|
||||
template<typename Type>
|
||||
inline const Type & cast() const ENTT_NOEXCEPT {
|
||||
assert(can_cast<Type>());
|
||||
ENTT_ASSERT(can_cast<Type>());
|
||||
return *internal::try_cast<Type>(node, instance);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
@@ -59,7 +58,7 @@ class scheduler {
|
||||
continuation(process_handler *ref)
|
||||
: handler{ref}
|
||||
{
|
||||
assert(handler);
|
||||
ENTT_ASSERT(handler);
|
||||
}
|
||||
|
||||
template<typename Proc, typename... Args>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
#include "../config/config.h"
|
||||
#include "fwd.hpp"
|
||||
|
||||
@@ -48,7 +47,7 @@ public:
|
||||
* @return A reference to the managed resource.
|
||||
*/
|
||||
const Resource & get() const ENTT_NOEXCEPT {
|
||||
assert(static_cast<bool>(resource));
|
||||
ENTT_ASSERT(static_cast<bool>(resource));
|
||||
return *resource;
|
||||
}
|
||||
|
||||
@@ -86,7 +85,7 @@ public:
|
||||
* contains no resource at all.
|
||||
*/
|
||||
inline const Resource * operator->() const ENTT_NOEXCEPT {
|
||||
assert(static_cast<bool>(resource));
|
||||
ENTT_ASSERT(static_cast<bool>(resource));
|
||||
return resource.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define ENTT_SIGNAL_DELEGATE_HPP
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
@@ -200,7 +199,7 @@ public:
|
||||
* @return The value returned by the underlying function.
|
||||
*/
|
||||
Ret operator()(Args... args) const {
|
||||
assert(fn);
|
||||
ENTT_ASSERT(fn);
|
||||
return fn(data, args...);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user