2 // Copyright (c) 2016-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)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_UNIT_TEST_AMOUNT_HPP
11 #define BOOST_BEAST_UNIT_TEST_AMOUNT_HPP
21 /** Utility for producing nicely composed output of amounts with units. */
26 std::string const& what_;
29 amount(amount const&) = default;
30 amount& operator=(amount const&) = delete;
32 template<class = void>
33 amount(std::size_t n, std::string const& what);
37 operator<<(std::ostream& s, amount const& t);
41 amount::amount(std::size_t n, std::string const& what)
49 operator<<(std::ostream& s, amount const& t)
51 s << t.n_ << " " << t.what_ <<((t.n_ != 1) ? "s" : "");