流运算符重载,方便读写文件中的数值数据
来源:互联网 发布:巫师3护甲穿刺数据 编辑:程序博客网 时间:2024/06/10 10:49
namespace NumbericalStream
{
template <class T>
std::ofstream& operator << (std::ofstream& os, const T out)
{
os.write((char*)&out,sizeof(out));
return os;
}
template <class T>
std::ifstream& operator >> ( std::ifstream& is, T & in )
{
is.read((char*)&in,sizeof(in));
return is;
}
};
namespace IntStream
{
template <class T>
std::ofstream& operator << (std::ofstream& os, const T out)
{
os.write((char*)&out,sizeof(out));
return os;
}
template <class T>
std::ifstream& operator >> ( std::ifstream& is, T & in )
{
is.read((char*)&in,sizeof(in));
return is;
}
};
- 流运算符重载,方便读写文件中的数值数据
- c++中的运算符重载
- c#中的运算符重载
- C#中的运算符重载
- C++中的运算符重载
- Lu中的运算符重载
- MFC中的运算符重载
- python中的运算符重载
- c++中的运算符重载
- C++中的运算符重载
- C++ 中的运算符重载
- C++中的运算符重载
- C++中的运算符重载
- c++中的运算符重载
- C++中的运算符重载
- C++中的重载运算符
- C++中的运算符重载
- C++ 中的运算符重载
- 比较java和C++的面向对象语法
- THL 公测版开发完毕,11.1.1发布~
- Oracle 10g Shrink Table 详解
- 关于傻逼(一)
- Python hello world
- 流运算符重载,方便读写文件中的数值数据
- 九宫算术解法
- 裴钰:从17个角度看汉字繁体字和简体字之争
- Apache 2.x 服务器中的URL重写的配置和应用
- PHP CRUL配置
- 深入探讨 Java 类加载器
- Python if and input
- PHP学习建议
- PHP学习建议