xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
beast
unit_test
include/xrpl/beast/unit_test/amount.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
#include <
cstddef
>
8
#include <
ostream
>
9
#include <
string
>
10
11
namespace
beast::unit_test
{
12
16
class
Amount
17
{
18
private
:
19
std::size_t
n_
;
20
std::string
const
&
what_
;
21
22
public
:
23
Amount
(
Amount
const
&) =
default
;
24
Amount
&
25
operator=
(
Amount
const
&) =
delete
;
26
27
template
<
class
=
void
>
28
Amount
(
std::size_t
n,
std::string
const
& what);
29
30
friend
std::ostream
&
31
operator<<
(
std::ostream
& s,
Amount
const
& t);
32
};
33
34
template
<
class
>
35
Amount::Amount
(
std::size_t
n,
std::string
const
& what) :
n_
(n),
what_
(what)
36
{
37
}
38
39
inline
std::ostream
&
40
operator<<
(
std::ostream
& s,
Amount
const
& t)
41
{
42
s << t.
n_
<<
" "
<< t.
what_
<< ((t.
n_
!= 1) ?
"s"
:
""
);
43
return
s;
44
}
45
46
}
// namespace beast::unit_test
std::ostream
std::string
beast::unit_test::Amount::n_
std::size_t n_
Definition
include/xrpl/beast/unit_test/amount.h:19
beast::unit_test::Amount::operator=
Amount & operator=(Amount const &)=delete
beast::unit_test::Amount::what_
std::string const & what_
Definition
include/xrpl/beast/unit_test/amount.h:20
beast::unit_test::Amount::Amount
Amount(Amount const &)=default
beast::unit_test::Amount::operator<<
friend std::ostream & operator<<(std::ostream &s, Amount const &t)
Definition
include/xrpl/beast/unit_test/amount.h:40
cstddef
beast::unit_test
Definition
include/xrpl/beast/unit_test/amount.h:11
beast::unit_test::operator<<
std::ostream & operator<<(std::ostream &s, Amount const &t)
Definition
include/xrpl/beast/unit_test/amount.h:40
ostream
std::size_t
string
Generated by
1.17.0