syncedprimitiveio.h

来自「这是整套横扫千军3D版游戏的源码」· C头文件 代码 · 共 32 行

H
32
字号
/* Author: Tobi Vollebregt */

#ifndef SYNCEDPRIMITIVEIO_H
#define SYNCEDPRIMITIVEIO_H

#if defined(SYNCDEBUG) || defined(SYNCCHECK)

#include <iostream>
#include "SyncedPrimitive.h"

/* I put these in a separate header to save the project from
#including the large iostream headers in every file. */

/* interface properly with stream objects in TdfParser etc. */

template<class T> inline std::ostream& operator<<(std::ostream& os, SyncedPrimitive<T>& f)
{
	os << f.x;
	return os;
}

template<class T> inline std::istream& operator>>(std::istream& is, SyncedPrimitive<T>& f)
{
	is >> f.x;
	f.Sync(">>");
	return is;
}

#endif // SYNCDEBUG || SYNCCHECK

#endif // SYNCEDPRIMITIVEIO_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?