2 // Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BEAST_UNIT_TEST_DETAIL_CONST_CONTAINER_HPP
9 #define BEAST_UNIT_TEST_DETAIL_CONST_CONTAINER_HPP
15 /** Adapter to constrain a container interface.
16 The interface allows for limited read only operations. Derived classes
17 provide additional behavior.
19 template<class Container>
23 using cont_type = Container;
33 cont_type const& cont() const
39 using value_type = typename cont_type::value_type;
40 using size_type = typename cont_type::size_type;
41 using difference_type = typename cont_type::difference_type;
42 using iterator = typename cont_type::const_iterator;
43 using const_iterator = typename cont_type::const_iterator;
45 /** Returns `true` if the container is empty. */
49 return m_cont.empty();
52 /** Returns the number of items in the container. */
59 /** Returns forward iterators for traversal. */
64 return m_cont.cbegin();
70 return m_cont.cbegin();