adaptor/internal/output.hpp
- View this file on GitHub
- Last update: 2024-06-01 20:31:58+09:00
- Include:
#include "adaptor/internal/output.hpp"
Depends on
Required by
adaptor/io.hpp
graph/centroid_decomposition.hpp
graph/connected_components.hpp
graph/internal/01bfs.hpp
graph/internal/bfs.hpp
graph/internal/dijkstra.hpp
graph/is_bipartite.hpp
graph/lowest_common_ancestor.hpp
graph/manhattan_minimum_spanning_tree.hpp
graph/minimum_paph_cover.hpp
graph/parse_grid.hpp
graph/reachability_test.hpp
graph/shortest_path.hpp
graph/spanning_tree.hpp
graph/topological_sort.hpp
graph/tree_diamiter.hpp
graph/tree_hash.hpp
include/adaptors.hpp
include/all.hpp
include/essential.hpp
include/graph_theory.hpp
include/template.hpp
structure/graph.hpp
template/small.hpp
template/standard.hpp
template/using.hpp
Verified with
verify/aizu-online-judge/0342/0000.test.cpp
verify/aizu-online-judge/1508/0000.test.cpp
verify/aizu-online-judge/1508/0001.test.cpp
verify/aizu-online-judge/1508/0002.test.cpp
verify/aizu-online-judge/1549/0000.test.cpp
verify/aizu-online-judge/1549/0001.test.cpp
verify/aizu-online-judge/1549/0002.test.cpp
verify/aizu-online-judge/1549/0003.test.cpp
verify/aizu-online-judge/2320/0000.test.cpp
verify/aizu-online-judge/2426/0000.test.cpp
verify/aizu-online-judge/alds1_10_c/0000.test.cpp
verify/aizu-online-judge/alds1_11_d/0000.test.cpp
verify/aizu-online-judge/alds1_11_d/0001.test.cpp
verify/aizu-online-judge/alds1_14_b/0000.test.cpp
verify/aizu-online-judge/cgl_1_a/0000.test.cpp
verify/aizu-online-judge/cgl_1_b/0000.test.cpp
verify/aizu-online-judge/cgl_1_c/0000.test.cpp
verify/aizu-online-judge/cgl_2_a/0000.test.cpp
verify/aizu-online-judge/cgl_2_b/0000.test.cpp
verify/aizu-online-judge/cgl_2_c/0000.test.cpp
verify/aizu-online-judge/cgl_3_a/0000.test.cpp
verify/aizu-online-judge/cgl_3_b/0000.test.cpp
verify/aizu-online-judge/cgl_4_a/0000.test.cpp
verify/aizu-online-judge/cgl_7_a/0000.test.cpp
verify/aizu-online-judge/cgl_7_b/0000.test.cpp
verify/aizu-online-judge/cgl_7_c/0000.test.cpp
verify/aizu-online-judge/dsl_1_a/0000.test.cpp
verify/aizu-online-judge/dsl_2_a/0000.test.cpp
verify/aizu-online-judge/dsl_2_d/0000.test.cpp
verify/aizu-online-judge/dsl_2_d/0001.test.cpp
verify/aizu-online-judge/dsl_2_d/0002.test.cpp
verify/aizu-online-judge/dsl_2_d/0003.test.cpp
verify/aizu-online-judge/dsl_2_d/0004.test.cpp
verify/aizu-online-judge/dsl_2_d/0005.test.cpp
verify/aizu-online-judge/dsl_2_d/0006.test.cpp
verify/aizu-online-judge/dsl_2_d/0007.test.cpp
verify/aizu-online-judge/dsl_2_d/0008.test.cpp
verify/aizu-online-judge/dsl_2_d/0009.test.cpp
verify/aizu-online-judge/dsl_2_e/0000.test.cpp
verify/aizu-online-judge/dsl_2_e/0001.test.cpp
verify/aizu-online-judge/dsl_2_f/0000.test.cpp
verify/aizu-online-judge/dsl_2_f/0001.test.cpp
verify/aizu-online-judge/dsl_2_f/0002.test.cpp
verify/aizu-online-judge/dsl_2_f/0003.test.cpp
verify/aizu-online-judge/dsl_2_f/0004.test.cpp
verify/aizu-online-judge/dsl_2_f/0005.test.cpp
verify/aizu-online-judge/dsl_2_g/0000.test.cpp
verify/aizu-online-judge/dsl_2_g/0001.test.cpp
verify/aizu-online-judge/dsl_2_g/0002.test.cpp
verify/aizu-online-judge/dsl_2_g/0003.test.cpp
verify/aizu-online-judge/dsl_2_h/0000.test.cpp
verify/aizu-online-judge/dsl_2_h/0001.test.cpp
verify/aizu-online-judge/dsl_2_h/0002.test.cpp
verify/aizu-online-judge/dsl_2_h/0003.test.cpp
verify/aizu-online-judge/dsl_2_h/0004.test.cpp
verify/aizu-online-judge/dsl_2_i/0000.test.cpp
verify/aizu-online-judge/grl_1_a/0000.test.cpp
verify/aizu-online-judge/itp1_1_a/0000.test.cpp
verify/aizu-online-judge/itp1_1_a/0001.test.cpp
verify/aizu-online-judge/itp1_1_a/0002.test.cpp
verify/aizu-online-judge/itp1_1_a/0003.test.cpp
verify/aizu-online-judge/itp1_1_a/0004.test.cpp
verify/aizu-online-judge/itp1_1_a/0005.test.cpp
verify/aizu-online-judge/itp1_1_a/0006.test.cpp
verify/aizu-online-judge/itp1_1_a/0007.test.cpp
verify/aizu-online-judge/itp1_1_a/0008.test.cpp
verify/aizu-online-judge/itp1_1_a/0009.test.cpp
verify/aizu-online-judge/itp1_1_a/0010.test.cpp
verify/aizu-online-judge/itp1_1_a/0011.test.cpp
verify/aizu-online-judge/itp1_1_a/0012.test.cpp
verify/aizu-online-judge/itp1_1_a/0013.test.cpp
verify/aizu-online-judge/itp1_1_a/0014.test.cpp
verify/aizu-online-judge/itp1_1_a/0015.test.cpp
verify/aizu-online-judge/itp1_6_c/0000.test.cpp
verify/aizu-online-judge/ntl_1_a/0000.test.cpp
verify/yosupo-judge/associative_array/0000.test.cpp
verify/yosupo-judge/associative_array/0001.test.cpp
verify/yosupo-judge/associative_array/0002.test.cpp
verify/yosupo-judge/associative_array/0003.test.cpp
verify/yosupo-judge/binomial_coefficient/0000.test.cpp
verify/yosupo-judge/binomial_coefficient_prime_mod/0000.test.cpp
verify/yosupo-judge/binomial_coefficient_prime_mod/0001.test.cpp
verify/yosupo-judge/binomial_coefficient_prime_mod/0002.test.cpp
verify/yosupo-judge/binomial_coefficient_prime_mod/0003.test.cpp
verify/yosupo-judge/bipartitematching/0000.test.cpp
verify/yosupo-judge/convolution_mod/0000.test.cpp
verify/yosupo-judge/convolution_mod_1000000007/0000.test.cpp
verify/yosupo-judge/counting_primes/0000.test.cpp
verify/yosupo-judge/deque_operate_all_composite/0000.test.cpp
verify/yosupo-judge/deque_operate_all_composite/0001.test.cpp
verify/yosupo-judge/deque_operate_all_composite/0002.test.cpp
verify/yosupo-judge/deque_operate_all_composite/0003.test.cpp
verify/yosupo-judge/deque_operate_all_composite/0004.test.cpp
verify/yosupo-judge/deque_operate_all_composite/0005.test.cpp
verify/yosupo-judge/double_ended_priority_queue/0000.test.cpp
verify/yosupo-judge/dynamic_sequence_range_affine_range_sum/0000.test.cpp
verify/yosupo-judge/dynamic_sequence_range_affine_range_sum/0001.test.cpp
verify/yosupo-judge/dynamic_sequence_range_affine_range_sum/0002.test.cpp
verify/yosupo-judge/dynamic_sequence_range_affine_range_sum/0003.test.cpp
verify/yosupo-judge/dynamic_sequence_range_affine_range_sum/0004.test.cpp
verify/yosupo-judge/dynamic_sequence_range_affine_range_sum/0005.test.cpp
verify/yosupo-judge/enumerate_primes/0000.test.cpp
verify/yosupo-judge/enumerate_quotients/0000.test.cpp
verify/yosupo-judge/factorize/0000.test.cpp
verify/yosupo-judge/gcd_convolution/0000.test.cpp
verify/yosupo-judge/kth_root_integer/0000.test.cpp
verify/yosupo-judge/lca/0000.test.cpp
verify/yosupo-judge/lca/0001.test.cpp
verify/yosupo-judge/lcm_convolution/0000.test.cpp
verify/yosupo-judge/longest_increasing_subsequence/0000.test.cpp
verify/yosupo-judge/manhattanmst/0000.test.cpp
verify/yosupo-judge/many_aplusb_128bit/0000.test.cpp
verify/yosupo-judge/matrix_det_arbitrary_mod/0000.test.cpp
verify/yosupo-judge/matrix_det_arbitrary_mod/0001.test.cpp
verify/yosupo-judge/matrix_product/0000.test.cpp
verify/yosupo-judge/matrix_product/0001.test.cpp
verify/yosupo-judge/matrix_product/0002.test.cpp
verify/yosupo-judge/matrix_product/0003.test.cpp
verify/yosupo-judge/matrix_product/0004.test.cpp
verify/yosupo-judge/matrix_product/0005.test.cpp
verify/yosupo-judge/matrix_product/0006.test.cpp
verify/yosupo-judge/matrix_product/0007.test.cpp
verify/yosupo-judge/matrix_product/0008.test.cpp
verify/yosupo-judge/matrix_product/0009.test.cpp
verify/yosupo-judge/matrix_product/0010.test.cpp
verify/yosupo-judge/matrix_product/0011.test.cpp
verify/yosupo-judge/matrix_product/0012.test.cpp
verify/yosupo-judge/matrix_product/0013.test.cpp
verify/yosupo-judge/matrix_product/0014.test.cpp
verify/yosupo-judge/matrix_product/0015.test.cpp
verify/yosupo-judge/persistent_queue/0000.test.cpp
verify/yosupo-judge/point_add_range_sum/0000.test.cpp
verify/yosupo-judge/point_add_range_sum/0001.test.cpp
verify/yosupo-judge/point_add_range_sum/0002.test.cpp
verify/yosupo-judge/point_add_range_sum/0003.test.cpp
verify/yosupo-judge/point_add_range_sum/0004.test.cpp
verify/yosupo-judge/point_set_range_composite/0000.test.cpp
verify/yosupo-judge/point_set_range_composite/0001.test.cpp
verify/yosupo-judge/point_set_range_composite/0002.test.cpp
verify/yosupo-judge/point_set_range_composite/0003.test.cpp
verify/yosupo-judge/predecessor_problem/0000.test.cpp
verify/yosupo-judge/predecessor_problem/0001.test.cpp
verify/yosupo-judge/predecessor_problem/0002.test.cpp
verify/yosupo-judge/predecessor_problem/0003.test.cpp
verify/yosupo-judge/primality_test/0000.test.cpp
verify/yosupo-judge/primitive_root/0000.test.cpp
verify/yosupo-judge/queue_operate_all_composite/0000.test.cpp
verify/yosupo-judge/queue_operate_all_composite/0001.test.cpp
verify/yosupo-judge/queue_operate_all_composite/0002.test.cpp
verify/yosupo-judge/queue_operate_all_composite/0003.test.cpp
verify/yosupo-judge/queue_operate_all_composite/0004.test.cpp
verify/yosupo-judge/queue_operate_all_composite/0005.test.cpp
verify/yosupo-judge/range_affine_range_sum/0000.test.cpp
verify/yosupo-judge/range_affine_range_sum/0001.test.cpp
verify/yosupo-judge/range_affine_range_sum/0002.test.cpp
verify/yosupo-judge/range_affine_range_sum/0003.test.cpp
verify/yosupo-judge/range_affine_range_sum/0004.test.cpp
verify/yosupo-judge/range_affine_range_sum/0005.test.cpp
verify/yosupo-judge/range_affine_range_sum/0006.test.cpp
verify/yosupo-judge/range_affine_range_sum/0007.test.cpp
verify/yosupo-judge/range_affine_range_sum/0008.test.cpp
verify/yosupo-judge/range_kth_smallest/0000.test.cpp
verify/yosupo-judge/range_kth_smallest/0001.test.cpp
verify/yosupo-judge/range_kth_smallest/0002.test.cpp
verify/yosupo-judge/range_kth_smallest/0003.test.cpp
verify/yosupo-judge/range_reverse_range_sum/0000.test.cpp
verify/yosupo-judge/rectangle_sum/0000.test.cpp
verify/yosupo-judge/rectangle_sum/0001.test.cpp
verify/yosupo-judge/shortest_path/0000.test.cpp
verify/yosupo-judge/shortest_path/0001.test.cpp
verify/yosupo-judge/shortest_path/0002.test.cpp
verify/yosupo-judge/static_range_frequency/0000.test.cpp
verify/yosupo-judge/static_range_frequency/0001.test.cpp
verify/yosupo-judge/static_range_sum/0000.test.cpp
verify/yosupo-judge/static_range_sum/0001.test.cpp
verify/yosupo-judge/static_range_sum/0002.test.cpp
verify/yosupo-judge/static_range_sum/0003.test.cpp
verify/yosupo-judge/static_range_sum/0004.test.cpp
verify/yosupo-judge/static_range_sum/0005.test.cpp
verify/yosupo-judge/static_range_sum/0006.test.cpp
verify/yosupo-judge/static_range_sum/0007.test.cpp
verify/yosupo-judge/static_range_sum/0008.test.cpp
verify/yosupo-judge/staticrmq/0000.test.cpp
verify/yosupo-judge/staticrmq/0001.test.cpp
verify/yosupo-judge/staticrmq/0002.test.cpp
verify/yosupo-judge/staticrmq/0003.test.cpp
verify/yosupo-judge/system_of_linear_equations/0000.test.cpp
verify/yukicoder/649/0000.test.cpp
verify/yukicoder/738/0000.test.cpp
verify/yukicoder/789/0000.test.cpp
verify/yukicoder/789/0001.test.cpp
Code
#pragma once
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <iterator>
#include <variant>
#include <ranges>
#include "internal/dev_env.hpp"
#include "internal/resolving_rank.hpp"
namespace uni {
template<class Destination = std::ostream>
struct output_adaptor {
using destination_type = Destination;
private:
template<class T>
requires
requires (destination_type& out, T val) {
out << val;
}
int _put(uni::internal::resolving_rank<5>, T&& val) noexcept(NO_EXCEPT) {
*this->out << std::forward<T>(val);
return 0;
}
template<class T>
requires
requires (T&& val) {
val.val();
}
int _put(uni::internal::resolving_rank<4>, T&& val) noexcept(NO_EXCEPT) {
this->put(val.val());
return 0;
}
template<std::ranges::input_range T>
int _put(uni::internal::resolving_rank<3>, T&& val) noexcept(NO_EXCEPT) {
(*this)(std::ranges::begin(val), std::ranges::end(val), false);
return 0;
}
template<class T>
requires
requires (T&& val) {
val.first;
val.second;
}
int _put(uni::internal::resolving_rank<2>, T&& val) noexcept(NO_EXCEPT) {
*this << val.first, this->put_separator();
*this << val.second;
return 0;
}
template<class T>
requires
requires (T&& val) {
std::get<0>(val);
}
auto _put(uni::internal::resolving_rank<1>, T&& val) noexcept(NO_EXCEPT) {
std::apply([this](const auto&... args) constexpr { ((*this << args, this->put_separator()), ...); }, std::forward<T>(val));
return 0;
}
template<std::input_or_output_iterator T>
int _put(uni::internal::resolving_rank<0>, T&& val) noexcept(NO_EXCEPT) {
(*this)(*std::forward<T>(val));
return 0;
}
protected:
template<class T>
destination_type* put(T&& val) noexcept(NO_EXCEPT){
this->_put(uni::internal::resolving_rank<10>{}, std::forward<T>(val));
return this->out;
}
public:
using char_type = typename destination_type::char_type;
static constexpr auto sendl = std::endl<char_type,std::char_traits<char_type>>;
static constexpr auto sflush = std::flush<char_type,std::char_traits<char_type>>;
protected:
using sfunc_type = std::remove_const_t<decltype(output_adaptor::sendl)>;
public:
using separator_type = std::variant<std::string,sfunc_type>;
destination_type *out;
separator_type endline;
separator_type separator;
protected:
void put_separator() noexcept(NO_EXCEPT) {
if(this->separator.index() == 0) *this->out << std::get<std::string>(this->separator);
if(this->separator.index() == 1) *this->out << std::get<sfunc_type>(this->separator);
}
void put_endline() noexcept(NO_EXCEPT) {
if(this->endline.index() == 0) *this->out << std::get<std::string>(this->endline);
if(this->endline.index() == 1) *this->out << std::get<sfunc_type>(this->endline);
}
public:
template<class Terminator = std::string, class Separator = std::string>
output_adaptor(destination_type *des = &std::cout, Terminator endl = "\n", Separator sep = " ") noexcept(NO_EXCEPT)
: out(des), endline(endl), separator(sep)
{
*this << std::fixed << std::setprecision(20);
}
inline auto& seekp(const typename destination_type::off_type off, const std::ios_base::seekdir dir = std::ios_base::cur) noexcept(NO_EXCEPT) {
this->out->seekp(off, dir); return *this;
};
template<class T> inline output_adaptor& operator<<(T&& s) noexcept(NO_EXCEPT){
this->put(std::forward<T>(s));
return *this;
}
template<class T = std::string>
inline auto& operator()(T&& val = "") noexcept(NO_EXCEPT){
*this << std::forward<T>(val), this->put_endline();
return *this;
}
template<class T, class ...Args>
inline auto& operator()(T&& head, Args&& ...tail) noexcept(NO_EXCEPT){
*this << std::forward<T>(head), this->put_separator();
(*this)(std::forward<Args>(tail)...);
return *this;
}
template<std::forward_iterator I, std::sentinel_for<I> S>
inline auto& operator()(I first, S last, const bool terminate = true) noexcept(NO_EXCEPT) {
for(I itr=first; itr!=last;) {
*this << *itr;
if(++itr == last) {
if(terminate) this->put_endline();
}
else this->put_separator();
}
return *this;
}
template<class T>
inline auto& operator()(const std::initializer_list<T> vals) noexcept(NO_EXCEPT) {
std::vector wrapped(vals.begin(), vals.end());
(*this)(wrapped.begin(), wrapped.end());
return *this;
}
template<class T0, class T1>
inline auto& conditional(const bool cond, const T0& a, const T1& b) noexcept(NO_EXCEPT) {
if(cond) (*this)(a);
else (*this)(b);
return *this;
}
inline auto& yesno(const bool cond) noexcept(NO_EXCEPT) {
if(cond) this->yes();
else this->no();
return *this;
}
inline auto yes() noexcept(NO_EXCEPT) {
*this->out << "Yes";
this->put_endline();
return *this;
}
inline auto no() noexcept(NO_EXCEPT) {
*this->out << "No";
this->put_endline();
return *this;
}
inline auto flush() noexcept(NO_EXCEPT) {
*this->out << std::flush;
return *this;
}
};
} // namespace uni
#line 2 "adaptor/internal/output.hpp"
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <iterator>
#include <variant>
#include <ranges>
#line 2 "internal/dev_env.hpp"
#ifdef LOCAL_JUDGE
inline constexpr bool DEV_ENV = true;
inline constexpr bool NO_EXCEPT = false;
#else
inline constexpr bool DEV_ENV = false;
inline constexpr bool NO_EXCEPT = true;
#endif // LOCAL_JUDGE
#if __cplusplus >= 202100L
#define CPP20 true
#define CPP23 true
#elif __cplusplus >= 202002L
#define CPP20 true
#define CPP23 false
#else
#define CPP20 false
#define CPP23 false
#endif
#line 2 "internal/resolving_rank.hpp"
namespace uni {
namespace internal {
template<int P> struct resolving_rank : resolving_rank<P-1> {};
template<> struct resolving_rank<0> {};
} // namespace internal
} // namespace uni
#line 15 "adaptor/internal/output.hpp"
namespace uni {
template<class Destination = std::ostream>
struct output_adaptor {
using destination_type = Destination;
private:
template<class T>
requires
requires (destination_type& out, T val) {
out << val;
}
int _put(uni::internal::resolving_rank<5>, T&& val) noexcept(NO_EXCEPT) {
*this->out << std::forward<T>(val);
return 0;
}
template<class T>
requires
requires (T&& val) {
val.val();
}
int _put(uni::internal::resolving_rank<4>, T&& val) noexcept(NO_EXCEPT) {
this->put(val.val());
return 0;
}
template<std::ranges::input_range T>
int _put(uni::internal::resolving_rank<3>, T&& val) noexcept(NO_EXCEPT) {
(*this)(std::ranges::begin(val), std::ranges::end(val), false);
return 0;
}
template<class T>
requires
requires (T&& val) {
val.first;
val.second;
}
int _put(uni::internal::resolving_rank<2>, T&& val) noexcept(NO_EXCEPT) {
*this << val.first, this->put_separator();
*this << val.second;
return 0;
}
template<class T>
requires
requires (T&& val) {
std::get<0>(val);
}
auto _put(uni::internal::resolving_rank<1>, T&& val) noexcept(NO_EXCEPT) {
std::apply([this](const auto&... args) constexpr { ((*this << args, this->put_separator()), ...); }, std::forward<T>(val));
return 0;
}
template<std::input_or_output_iterator T>
int _put(uni::internal::resolving_rank<0>, T&& val) noexcept(NO_EXCEPT) {
(*this)(*std::forward<T>(val));
return 0;
}
protected:
template<class T>
destination_type* put(T&& val) noexcept(NO_EXCEPT){
this->_put(uni::internal::resolving_rank<10>{}, std::forward<T>(val));
return this->out;
}
public:
using char_type = typename destination_type::char_type;
static constexpr auto sendl = std::endl<char_type,std::char_traits<char_type>>;
static constexpr auto sflush = std::flush<char_type,std::char_traits<char_type>>;
protected:
using sfunc_type = std::remove_const_t<decltype(output_adaptor::sendl)>;
public:
using separator_type = std::variant<std::string,sfunc_type>;
destination_type *out;
separator_type endline;
separator_type separator;
protected:
void put_separator() noexcept(NO_EXCEPT) {
if(this->separator.index() == 0) *this->out << std::get<std::string>(this->separator);
if(this->separator.index() == 1) *this->out << std::get<sfunc_type>(this->separator);
}
void put_endline() noexcept(NO_EXCEPT) {
if(this->endline.index() == 0) *this->out << std::get<std::string>(this->endline);
if(this->endline.index() == 1) *this->out << std::get<sfunc_type>(this->endline);
}
public:
template<class Terminator = std::string, class Separator = std::string>
output_adaptor(destination_type *des = &std::cout, Terminator endl = "\n", Separator sep = " ") noexcept(NO_EXCEPT)
: out(des), endline(endl), separator(sep)
{
*this << std::fixed << std::setprecision(20);
}
inline auto& seekp(const typename destination_type::off_type off, const std::ios_base::seekdir dir = std::ios_base::cur) noexcept(NO_EXCEPT) {
this->out->seekp(off, dir); return *this;
};
template<class T> inline output_adaptor& operator<<(T&& s) noexcept(NO_EXCEPT){
this->put(std::forward<T>(s));
return *this;
}
template<class T = std::string>
inline auto& operator()(T&& val = "") noexcept(NO_EXCEPT){
*this << std::forward<T>(val), this->put_endline();
return *this;
}
template<class T, class ...Args>
inline auto& operator()(T&& head, Args&& ...tail) noexcept(NO_EXCEPT){
*this << std::forward<T>(head), this->put_separator();
(*this)(std::forward<Args>(tail)...);
return *this;
}
template<std::forward_iterator I, std::sentinel_for<I> S>
inline auto& operator()(I first, S last, const bool terminate = true) noexcept(NO_EXCEPT) {
for(I itr=first; itr!=last;) {
*this << *itr;
if(++itr == last) {
if(terminate) this->put_endline();
}
else this->put_separator();
}
return *this;
}
template<class T>
inline auto& operator()(const std::initializer_list<T> vals) noexcept(NO_EXCEPT) {
std::vector wrapped(vals.begin(), vals.end());
(*this)(wrapped.begin(), wrapped.end());
return *this;
}
template<class T0, class T1>
inline auto& conditional(const bool cond, const T0& a, const T1& b) noexcept(NO_EXCEPT) {
if(cond) (*this)(a);
else (*this)(b);
return *this;
}
inline auto& yesno(const bool cond) noexcept(NO_EXCEPT) {
if(cond) this->yes();
else this->no();
return *this;
}
inline auto yes() noexcept(NO_EXCEPT) {
*this->out << "Yes";
this->put_endline();
return *this;
}
inline auto no() noexcept(NO_EXCEPT) {
*this->out << "No";
this->put_endline();
return *this;
}
inline auto flush() noexcept(NO_EXCEPT) {
*this->out << std::flush;
return *this;
}
};
} // namespace uni