xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
beast
unit_test
detail
const_container.h
1
// Distributed under the Boost Software License, Version 1.0. (See accompanying
2
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
3
//
4
5
#pragma once
6
7
namespace
beast::unit_test::detail
{
8
14
template
<
class
Container>
15
class
ConstContainer
16
{
17
private
:
18
using
ContType
= Container;
19
20
ContType
cont_
;
21
22
protected
:
23
ContType
&
24
cont
()
25
{
26
return
cont_
;
27
}
28
29
[[nodiscard]]
ContType
const
&
30
cont
()
const
31
{
32
return
cont_
;
33
}
34
35
public
:
36
using
value_type
= ContType::value_type;
37
using
size_type
= ContType::size_type;
38
using
difference_type
= ContType::difference_type;
39
using
iterator
= ContType::const_iterator;
40
using
const_iterator
= ContType::const_iterator;
41
45
[[nodiscard]]
bool
46
empty
()
const
47
{
48
return
cont_
.empty();
49
}
50
54
[[nodiscard]]
size_type
55
size
()
const
56
{
57
return
cont_
.size();
58
}
59
64
[[nodiscard]]
const_iterator
65
begin
()
const
66
{
67
return
cont_
.cbegin();
68
}
69
70
[[nodiscard]]
const_iterator
71
cbegin
()
const
72
{
73
return
cont_
.cbegin();
74
}
75
76
[[nodiscard]]
const_iterator
77
end
()
const
78
{
79
return
cont_
.cend();
80
}
81
82
[[nodiscard]]
const_iterator
83
cend
()
const
84
{
85
return
cont_
.cend();
86
}
87
88
};
89
90
}
// namespace beast::unit_test::detail
beast::unit_test::detail::ConstContainer
Adapter to constrain a container interface.
Definition
const_container.h:16
beast::unit_test::detail::ConstContainer::cend
const_iterator cend() const
Definition
const_container.h:83
beast::unit_test::detail::ConstContainer::size
size_type size() const
Returns the number of items in the container.
Definition
const_container.h:55
beast::unit_test::detail::ConstContainer::const_iterator
ContType::const_iterator const_iterator
Definition
const_container.h:40
beast::unit_test::detail::ConstContainer::value_type
ContType::value_type value_type
Definition
const_container.h:36
beast::unit_test::detail::ConstContainer::iterator
ContType::const_iterator iterator
Definition
const_container.h:39
beast::unit_test::detail::ConstContainer::end
const_iterator end() const
Definition
const_container.h:77
beast::unit_test::detail::ConstContainer::cont_
ContType cont_
Definition
const_container.h:20
beast::unit_test::detail::ConstContainer::difference_type
ContType::difference_type difference_type
Definition
const_container.h:38
beast::unit_test::detail::ConstContainer::size_type
ContType::size_type size_type
Definition
const_container.h:37
beast::unit_test::detail::ConstContainer::empty
bool empty() const
Returns true if the container is empty.
Definition
const_container.h:46
beast::unit_test::detail::ConstContainer::cbegin
const_iterator cbegin() const
Definition
const_container.h:71
beast::unit_test::detail::ConstContainer::ContType
Container ContType
Definition
const_container.h:18
beast::unit_test::detail::ConstContainer::cont
ContType & cont()
Definition
const_container.h:24
beast::unit_test::detail::ConstContainer::cont
ContType const & cont() const
Definition
const_container.h:30
beast::unit_test::detail::ConstContainer::begin
const_iterator begin() const
Returns forward iterators for traversal.
Definition
const_container.h:65
beast::unit_test::detail
Definition
const_container.h:7
Generated by
1.17.0