Template Function otyca::has_same_size
Function Documentation
-
template<typename Container>
bool otyca::has_same_size(const Container &c1, const Container &c2) Checks if two containers have the same size, including recursively checking the sizes of nested containers.
This function compares the sizes of two containers,
c1
andc2
. It first checks if the top-level sizes are the same. If the containers contain other containers as elements, the function recursively checks the sizes of the inner containers.Note
The function uses template metaprogramming with
constexpr
to recursively check the sizes of nested containers. It assumes that if a container has avalue_type
, it may contain other containers.- Template Parameters:
Container – Type of the containers to be compared.
- Parameters:
c1 – The first container to compare.
c2 – The second container to compare.
- Returns:
true
if the containers have the same size at all levels,false
otherwise.