#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
Archiviert am 14.02.2026
valid-html401.png patent_button.gif anybrowser.gif permaplant.png vim.gif elektra.jpg fsfe-logo.png valid-css.png