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

c – std :: fstream和Boost Iostreams Library之间的区别,第1张

概述我是BOOST图书馆的新手.今天我看到了一个小代码段,其中读取和写入PGM格式图像是通过Boost Iostreams Library实现的.由于我对STL更熟悉,我可以轻松地告诉std :: fstream可以做同样的工作.那么我的问题是,在如此简单的阅读和编写PGM图像应用程序中使用Boost库有什么意义呢?此外,我想知道最需要BOOST Iostreams Library的情况.谢谢! 来自 我是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.
总结

以上是内存溢出为你收集整理的c – std :: fstream和Boost Iostreams Library之间区别全部内容,希望文章能够帮你解决c – std :: fstream和Boost Iostreams Library之间的区别所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1230422.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-06
下一篇 2022-06-06

发表评论

登录后才能评论

评论列表(0条)

保存