meta: decouple container operations for coverage purposes and share them properly

This commit is contained in:
Michele Caini
2023-08-02 09:46:32 +02:00
parent b7d23e1aec
commit 049860b884
3 changed files with 40 additions and 36 deletions

View File

@@ -60,7 +60,7 @@ class basic_meta_sequence_container_traits {
friend meta_sequence_container;
using operation = internal::meta_container_operation;
using operation = internal::meta_sequence_container_operation;
using size_type = typename meta_sequence_container::size_type;
using iterator = typename meta_sequence_container::iterator;
@@ -124,9 +124,6 @@ class basic_meta_sequence_container_traits {
}
}
break;
default:
// nothing to do here
break;
}
@@ -146,7 +143,7 @@ class basic_meta_associative_container_traits {
static constexpr auto key_only = internal::key_only_associative_container<Type>::value;
using operation = internal::meta_container_operation;
using operation = internal::meta_associative_container_operation;
using size_type = typename meta_associative_container::size_type;
using iterator = typename meta_associative_container::iterator;
@@ -208,9 +205,6 @@ class basic_meta_associative_container_traits {
return true;
}
break;
default:
// nothing to do here
break;
}

View File

@@ -26,36 +26,10 @@ namespace entt {
class meta_any;
class meta_type;
/**
* @cond TURN_OFF_DOXYGEN
* Internal details not to be documented.
*/
namespace internal {
enum class meta_container_operation {
size,
clear,
reserve,
resize,
begin,
end,
insert,
erase,
find
};
} // namespace internal
/**
* Internal details not to be documented.
* @endcond
*/
/*! @brief Proxy object for sequence containers. */
class meta_sequence_container {
class meta_iterator;
using operation = internal::meta_container_operation;
using operation = internal::meta_sequence_container_operation;
public:
/*! @brief Unsigned integer type. */
@@ -109,7 +83,7 @@ private:
/*! @brief Proxy object for associative containers. */
class meta_associative_container {
class meta_iterator;
using operation = internal::meta_container_operation;
using operation = internal::meta_associative_container_operation;
public:
/*! @brief Unsigned integer type. */

View File

@@ -6,6 +6,42 @@
namespace entt {
/**
* @cond TURN_OFF_DOXYGEN
* Internal details not to be documented.
*/
namespace internal {
enum class meta_sequence_container_operation {
size,
clear,
reserve,
resize,
begin,
end,
insert,
erase
};
enum class meta_associative_container_operation {
size,
clear,
reserve,
begin,
end,
insert,
erase,
find
};
} // namespace internal
/**
* Internal details not to be documented.
* @endcond
*/
/**
* @brief Traits class template to be specialized to enable support for meta
* template information.