C++Spec 1.0.0
BDD testing for C++
Loading...
Searching...
No Matches
CppSpec::Util::is_container Concept Reference

Concept for checking whether T is a container type. More...

#include <util.hpp>

Concept definition

template<typename C>
concept CppSpec::Util::is_container = requires(C c) {
requires std::ranges::range<C>;
{ c.max_size() } -> std::integral;
{ c.empty() } -> std::convertible_to<bool>;
}
Concept for checking whether T is a container type.
Definition util.hpp:65

Detailed Description

Concept for checking whether T is a container type.

Provides the member constant value which is equal to true, if T is a container type. Otherwise, value is equal to false.

A container is defined by having the functions begin, end, max_size, and empty.

Template Parameters
Ta type to check