|
|
@@ -37,7 +37,7 @@ class meta_factory;
|
|
|
*/
|
|
|
template<typename Type, typename... Spec>
|
|
|
class meta_factory<Type, Spec...>: public meta_factory<Type> {
|
|
|
- void link_prop_if_required(internal::meta_prop_node &node) {
|
|
|
+ void link_prop_if_required(internal::meta_prop_node &node) ENTT_NOEXCEPT {
|
|
|
if(meta_range<internal::meta_prop_node *, internal::meta_prop_node> range{*ref}; std::find(range.cbegin(), range.cend(), &node) == range.cend()) {
|
|
|
ENTT_ASSERT(std::find_if(range.cbegin(), range.cend(), [&node](const auto *curr) { return curr->id == node.id; }) == range.cend(), "Duplicate identifier");
|
|
|
node.next = *ref;
|
|
|
@@ -46,25 +46,25 @@ class meta_factory<Type, Spec...>: public meta_factory<Type> {
|
|
|
}
|
|
|
|
|
|
template<std::size_t Step = 0, typename... Property, typename... Other>
|
|
|
- void unroll(choice_t<2>, std::tuple<Property...> property, Other &&...other) {
|
|
|
+ void unroll(choice_t<2>, std::tuple<Property...> property, Other &&...other) ENTT_NOEXCEPT {
|
|
|
std::apply([this](auto &&...curr) { (this->unroll<Step>(choice<2>, std::forward<Property>(curr)...)); }, property);
|
|
|
unroll<Step + sizeof...(Property)>(choice<2>, std::forward<Other>(other)...);
|
|
|
}
|
|
|
|
|
|
template<std::size_t Step = 0, typename... Property, typename... Other>
|
|
|
- void unroll(choice_t<1>, std::pair<Property...> property, Other &&...other) {
|
|
|
+ void unroll(choice_t<1>, std::pair<Property...> property, Other &&...other) ENTT_NOEXCEPT {
|
|
|
assign<Step>(std::move(property.first), std::move(property.second));
|
|
|
unroll<Step + 1>(choice<2>, std::forward<Other>(other)...);
|
|
|
}
|
|
|
|
|
|
template<std::size_t Step = 0, typename Property, typename... Other>
|
|
|
- void unroll(choice_t<0>, Property &&property, Other &&...other) {
|
|
|
+ void unroll(choice_t<0>, Property &&property, Other &&...other) ENTT_NOEXCEPT {
|
|
|
assign<Step>(std::forward<Property>(property));
|
|
|
unroll<Step + 1>(choice<2>, std::forward<Other>(other)...);
|
|
|
}
|
|
|
|
|
|
template<std::size_t>
|
|
|
- void unroll(choice_t<0>) {}
|
|
|
+ void unroll(choice_t<0>) ENTT_NOEXCEPT {}
|
|
|
|
|
|
template<std::size_t = 0>
|
|
|
void assign(meta_any key, meta_any value = {}) {
|
|
|
@@ -138,28 +138,28 @@ private:
|
|
|
*/
|
|
|
template<typename Type>
|
|
|
class meta_factory<Type> {
|
|
|
- void link_base_if_required(internal::meta_base_node &node) {
|
|
|
+ void link_base_if_required(internal::meta_base_node &node) ENTT_NOEXCEPT {
|
|
|
if(meta_range<internal::meta_base_node *, internal::meta_base_node> range{owner->base}; std::find(range.cbegin(), range.cend(), &node) == range.cend()) {
|
|
|
node.next = owner->base;
|
|
|
owner->base = &node;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void link_conv_if_required(internal::meta_conv_node &node) {
|
|
|
+ void link_conv_if_required(internal::meta_conv_node &node) ENTT_NOEXCEPT {
|
|
|
if(meta_range<internal::meta_conv_node *, internal::meta_conv_node> range{owner->conv}; std::find(range.cbegin(), range.cend(), &node) == range.cend()) {
|
|
|
node.next = owner->conv;
|
|
|
owner->conv = &node;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void link_ctor_if_required(internal::meta_ctor_node &node) {
|
|
|
+ void link_ctor_if_required(internal::meta_ctor_node &node) ENTT_NOEXCEPT {
|
|
|
if(meta_range<internal::meta_ctor_node *, internal::meta_ctor_node> range{owner->ctor}; std::find(range.cbegin(), range.cend(), &node) == range.cend()) {
|
|
|
node.next = owner->ctor;
|
|
|
owner->ctor = &node;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void link_data_if_required(const id_type id, internal::meta_data_node &node) {
|
|
|
+ void link_data_if_required(const id_type id, internal::meta_data_node &node) ENTT_NOEXCEPT {
|
|
|
meta_range<internal::meta_data_node *, internal::meta_data_node> range{owner->data};
|
|
|
ENTT_ASSERT(std::find_if(range.cbegin(), range.cend(), [id, &node](const auto *curr) { return curr != &node && curr->id == id; }) == range.cend(), "Duplicate identifier");
|
|
|
node.id = id;
|
|
|
@@ -170,7 +170,7 @@ class meta_factory<Type> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void link_func_if_required(const id_type id, internal::meta_func_node &node) {
|
|
|
+ void link_func_if_required(const id_type id, internal::meta_func_node &node) ENTT_NOEXCEPT {
|
|
|
node.id = id;
|
|
|
|
|
|
if(meta_range<internal::meta_func_node *, internal::meta_func_node> range{owner->func}; std::find(range.cbegin(), range.cend(), &node) == range.cend()) {
|
|
|
@@ -205,7 +205,7 @@ class meta_factory<Type> {
|
|
|
|
|
|
public:
|
|
|
/*! @brief Default constructor. */
|
|
|
- meta_factory()
|
|
|
+ meta_factory() ENTT_NOEXCEPT
|
|
|
: owner{internal::meta_node<Type>::resolve()} {}
|
|
|
|
|
|
/**
|
|
|
@@ -213,7 +213,7 @@ public:
|
|
|
* @param id Optional unique identifier.
|
|
|
* @return An extended meta factory for the given type.
|
|
|
*/
|
|
|
- auto type(const id_type id = type_hash<Type>::value()) {
|
|
|
+ auto type(const id_type id = type_hash<Type>::value()) ENTT_NOEXCEPT {
|
|
|
meta_range<internal::meta_type_node *, internal::meta_type_node> range{*internal::meta_context::global()};
|
|
|
ENTT_ASSERT(std::find_if(range.cbegin(), range.cend(), [id, this](const auto *curr) { return curr != owner && curr->id == id; }) == range.cend(), "Duplicate identifier");
|
|
|
owner->id = id;
|