Skip to content

Virv12/fastio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastio

Modern c++ fastio

Usage

#include "fastio.h"

IOfast::Ifast fastin(STDIN_FILENO);
IOfast::Ofast fastout(STDOUT_FILENO);

int main() {
	int x;
	fastin >> x;

	fastout << "X: " << x << '\n';
	fastout.fmt<"X: %\n">(x); // Only with c++20

	fastout.flush();
}
#include "fastio.h"

IOfast::Ofast fastout(STDOUT_FILENO);

struct S {
	int a, b;
};

auto &operator<<(IOfast::Ofast &out, S s) { return out << '{' << s.a << ", " << s.b << '}'; }

int main() {
	S s{3, 4};
	fastout << s << '\n';
	fastout.fmt<"Custom type: %\n">(s); // Only with c++20
	fastout.flush();
}

Releases

No releases published

Packages

No packages published