加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – std :: fstream和Boost Iostreams Library之间的区别

发布时间:2020-12-16 07:32:11 所属栏目:百科 来源:网络整理
导读:我是BOOST图书馆的新手.今天我看到了一个小代码段,其中读取和写入PGM格式图像是通过Boost Iostreams Library实现的.由于我对STL更熟悉,我可以轻松地告诉std :: fstream可以做同样的工作.那么我的问题是,在如此简单的阅读和编写PGM图像应用程序中使用Boost库
我是BOOST图书馆的新手.今天我看到了一个小代码段,其中读取和写入PGM格式图像是通过Boost Iostreams Library实现的.由于我对STL更熟悉,我可以轻松地告诉std :: fstream可以做同样的工作.那么我的问题是,在如此简单的阅读和编写PGM图像应用程序中使用Boost库有什么意义呢?此外,我想知道最需要BOOST Iostreams Library的情况.谢谢!

解决方法

来自std :: fstream reference:

fstream provides an interface to read and write data from files as
input/output streams.

从Boost.Iostreams reference开始:

Boost.Iostreams has three aims:

  • To make it easy to create standard C++ streams and stream buffers for accessing new Sources and Sinks.
  • To provide a framework for defining Filters and attaching them to standard streams and stream buffers.
  • To provide a collection of ready-to-use Filters,Sources and Sinks.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读