#ifndef PERCENT_IO_H
#define PERCENT_IO_H

#include "percent.h"

#include 

std::ostream & operator<<(std::ostream & os, Percent const & percent)
{
	os << static_cast(percent) << '%';
	return os;
}

std::istream & operator>>(std::istream & is, Percent & percent)
{
	int p;
	is >> p;
	if (is.fail())
	{
		return is;
	}

	char c;
	is >> c;
	if (c != '%')
	{
		is.setstate(std::ios::failbit);
	}

	percent = p;
	return is;
}

#endif
Fr Jul 30 13:54:24 CEST 2021
patent_button.gif valid-html401.png elektra.jpg fsfe-logo.png valid-css.png vim.gif anybrowser.gif