is_container

Description

A container is an object used to store other objects and takes care of the management of the memory used by the objects it contains.

Synopsis

TICK_TRAIT(is_container,
    is_equality_comparable<_>,
    is_default_constructible<_>,
    is_copy_constructible<_>,
    is_copy_assignable<_>,
    is_destructible<_>,
    is_swappable<_>,
    is_range<_>,
    /* is_copy_insertable_container<_> */
)
{
    template<class T>
    auto require(const T& x) -> valid<
        has_type<typename T::iterator, is_iterator<_>>,
        has_type<typename T::const_iterator, is_iterator<_>>,
        has_type<typename T::value_type>,
        has_type<typename T::reference, typename T::value_type&>,
        has_type<typename T::const_reference, const typename T::value_type&>,
        has_type<typename T::difference_type, int>,
        has_type<typename T::size_type, unsigned>,
        decltype(returns<typename T::size_type>(x.size())),
        decltype(returns<typename T::size_type>(x.max_size())),
        decltype(returns<bool>(x.empty()))
    >;
};