All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
gears::concepts::Container< T > Struct Template Reference

Checks if a type is a container. More...

Inherits gears::concepts::And< Or< TraitOf< detail::is_container, T >, TraitOf< detail::is_forward_list, T > >, Regular< T >, EqualityComparable< T >, Copyable< T >, Destructible< T > >.

Detailed Description

template<typename T>
struct gears::concepts::Container< T >

A Unary concept that checks if a type is a container.

A type that meets this concept must provide the following typedefs:

  • value_type
  • reference
  • const_reference
  • iterator
  • const_iterator
  • difference_type
  • size_type

It must meet the following concepts:

The following expressions must be valid:

auto a = x.begin(); // returns iterator or const_iterator
auto b = x.end(); // returns iterator or const_iterator
auto c = x.cbegin() // returns const_iterator
auto d = x.cend() // returns const_iterator
x.swap(y);
auto e = x.size() // returns size_type
auto f = x.max_size(); // returns size_type
bool g = x.empty();

Where x and y are instances of T.

There is a specialisation for std::forward_list<T> to make it a valid container.

Template Parameters
TType to check.

Definition at line 221 of file container.hpp.