add primary container and concepts for logger

This commit is contained in:
2025-09-10 00:10:30 +03:00
parent 86d4535401
commit 057dc595ac
5 changed files with 246 additions and 81 deletions

View File

@@ -66,13 +66,6 @@ void example_is_sequence_container(const T& container)
hack::log()("Sequence container with ", container.size(), " elements");
}
template<hack::concepts::is_random_access_container T>
void example_is_random_access_container(T& container)
{
if (!container.empty())
hack::log()("First element: ", container[0]);
}
template<hack::concepts::is_container_adapter T>
void example_is_container_adapter(T& adapter)
{
@@ -139,15 +132,6 @@ void check_support(const T& value)
hack::log()("Type is supported");
}
template<hack::concepts::has_key_value_semantics T>
void example_has_key_value_semantics(T& container)
{
if constexpr (hack::concepts::has_mapped_type<T>)
hack::log()("Key-value container, sample access demonstrated");
else
hack::log()("Set-like container");
}
template<hack::concepts::is_contiguous_container T>
void example_is_contiguous_container(const T& container)
{
@@ -210,9 +194,7 @@ auto main(int argc, char *argv[]) -> int
example_is_string(str);
example_is_sequence_container(vec);
example_is_sequence_container(list);
example_is_random_access_container(vec);
example_is_container_adapter(stack);
example_is_associative_container(set);
example_is_unordered_associative_container(umap);
example_is_tuple_like(tuple);
example_is_fixed_array(fixed_array);
@@ -222,7 +204,6 @@ auto main(int argc, char *argv[]) -> int
example_is_sized(vec);
check_support(a);
check_support(custom);
example_has_key_value_semantics(map);
example_is_contiguous_container(vec);
example_can_push_front(list, 0);
example_can_push_back(vec, 99);