腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
我如何理解std::make_shared的工作原理?
c++
、
shared
): std::vector<char> buffer(std::
istreambuf_iterator
ifstream ifs("myfile.bin", std::ios::binary); auto sp = std::make_shared<std::vector<char>>(std::
istreambuf_iterator
&
浏览 2
提问于2021-05-27
得票数 2
回答已采纳
1
回答
C++
istreambuf_iterator
模板
参数
c++
、
streambuf
、
istream-iterator
基于这个问题:
istreambuf_iterator
上的,我的理解是
istreambuf_iterator
是一个用于原始输入而不是格式化输入的迭代器。在这种情况下,假设
istreambuf_iterator
的
模板
参数
只能是那些与char相关的
参数
,比如
istreambuf_iterator
<char>、
istreambuf_iterator
<wchar_t>,并且像
istreambuf_iterator
<
浏览 18
提问于2018-08-02
得票数 0
回答已采纳
1
回答
没有匹配的对std:: find ()的调用,尽管其他find语句可以工作,并且包含了<algorithm>
c++
、
c++11
、
std
:369:5:注释:候选:
模板
类型名称__gnu_cxx::__enable_if::__value,std::
istreambuf_iterator
<_CharT> >::__type std::find(std::
istreambuf_iterator
<_CharT>,std::
istreambuf_iterator
<_CharT>,( _CharT2&)
istreambuf_iterator
<_CharT> __first,
浏览 4
提问于2019-09-20
得票数 0
回答已采纳
1
回答
为什么在文件读取功能中会有额外的括号?
c++
、
compiler-errors
、
ifstream
include <fstream> std::string content( (std::
istreambuf_iterator
<char>(ifs) ),然而,我不明白为什么需要这些看似多余的括号#include <fstream> #i
浏览 0
提问于2012-09-26
得票数 7
回答已采纳
1
回答
为什么在构造字符串时`std::
istreambuf_iterator
<char>`被视为函数声明?
c++
、
parameters
、
expression
、
ambiguity
、
function-declaration
许多编码人员可能会混淆这段代码: std::ifstream ifs("filename", std::ios::binary); // ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
浏览 4
提问于2020-02-21
得票数 1
回答已采纳
2
回答
无法将文件读入向量
c++
我有一个文件,它在三行上有三个ints。看起来是这样的: 001 #include <fstream>#include <vector> { std::fstream out("out.txt"); std::copy(std::ostreambuf_iterator<int>(out.rd
浏览 0
提问于2013-03-29
得票数 3
回答已采纳
1
回答
g++ 4.6.3将文件内容读入字符串解析歧义
c++
、
g++
include <vector>#include <fstream> std::vector<char> buf(std::
istreambuf_iterator
<char>(stream),但当我说:...我犯了个错误 error: request for member 'siz
浏览 4
提问于2015-04-24
得票数 5
回答已采纳
1
回答
istream_iterators :find不适用于
c++
、
iterator
该代码不编译,会产生关于
模板
类型扣减失败的错误。istream_iterator >&&,std::__cxx11::string&)‘auto = std::find(is,end,std::__cxx11::string&)没有匹配函数; 注:候选:
模板
类型名称__gnu_cxx::__enable_if::__value,std::
istreambuf_iterator
<_CharT> >::__type std::find(std::
istreambuf_iterato
浏览 1
提问于2015-10-21
得票数 2
回答已采纳
1
回答
一位新学习者制作的
C++
模板
和迭代器的代码错误
c++
、
c++11
、
templates
、
iterator
作为一个
C++
新手,当我尝试学习
C++
的
模板
和迭代器时,我编写了一个函数,通过使用
C++
的
模板
和迭代器来检查一个数字是否包含一个数组。+/algorithm:62,C:/LLVM/lib/gcc/x86_64-w64-mingw32/8.1.0/include/
c+
'template<class _CharT2> ty
浏览 1
提问于2022-01-12
得票数 0
回答已采纳
1
回答
从文件到向量,文件大小错误
c++11
、
vector
、
filestream
、
filesize
我找到了很多关于这个问题的文章,但是没有人详细地解释了这一点,而且我仍然对streams缺乏经验:我想将一个文件流到一个向量中,并且这个向量已经被定义了,并且包含了一些数据。std::ifstream fileInputStream(path.wc_str(), std::ios::binary);byteVector->insert(byteVector->end(),
浏览 2
提问于2020-09-02
得票数 0
回答已采纳
1
回答
在
C++
中等效于用于缓冲读取的python生成器
c++
、
python
、
algorithm
、
file
、
io
f.read(4000)) break yield x 出于速度上的原因,我需要在
C+
我是不是用
istreambuf_iterator
在正确的树上吠叫
浏览 2
提问于2011-01-13
得票数 3
回答已采纳
1
回答
std::ifstream一次读取32位
c++
但是在char32_t上使用ifstream
模板
时,我希望它一次读取4个字节,但在streambuf内部它会读取单个字符,然后将其转换为char32_t,所以距离是24。当使用std::
istreambuf_iterator
时,为什么std::basic_ifstream不能一次读取32位。如果这只是读取一个字符,执行到char32_t的强制转换,那么
模板
参数
的意义是什么,如何使用std::
istreambuf_iterator
一次读取32位的文件。:basic_ifstream<char32_t&
浏览 0
提问于2018-11-21
得票数 1
1
回答
函数与
C++
中的变量声明
c++
、
variables
、
function
、
declaration
下面的代码可以工作:std::string s = std::string(std::
istreambuf_iterator
<char>(f), std::
istreambuf_iterator
<char>());因此mapFilename是一个std::string和void ParseGameState而这并不是:std::string
浏览 1
提问于2010-09-12
得票数 12
回答已采纳
1
回答
vector<string>和find:
模板
参数
演绎/替换失败?
c++
、
templates
、
c++11
、
compiler-errors
、
iterator
/
c++
/4.7/ios:45, from /usr/include> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::
istreambuf_iterator
<_CharT2,s
浏览 2
提问于2014-03-02
得票数 3
回答已采纳
2
回答
将文件读入stl vector时删除\r\n
c++
、
stl
我使用下面的
C++
stl结构将文件读入vector of charactersstd::vector<char> fileContents((std::
istreambuf_iterator
<char>(testFile)), std::
istreambuf_iterator
<char>()); 但这也会将
浏览 0
提问于2012-09-11
得票数 0
回答已采纳
1
回答
从std::cin读取X字节,并将字符串截断为X字节长度
c++
、
string
我有一个
c++
程序,它接收来自linux管道的输入,并输出到std::cout以供进一步处理。目前,我的代码如下所示:std::
istreambuf_iterator
<char> end; std::string如何将大约100 of的cin读入
c++
字符串,而忽略其余的?如何将
c++
字符串截断为65535字节而不是字符?(今后我需要处理多字节字符。)
浏览 8
提问于2009-04-30
得票数 1
1
回答
如何使用std::
istreambuf_iterator
来初始化字符串
c++
、
string
、
iterator
const std::string source = ([&]() { return std::string{std::
istreambuf_iterator
<char>{file}, std::
istreambuf_iterator
<char>{}};} 有人能向我解释一下这一行到底发生了什么吗?return std::string{std::
istreambuf_iterator
<char>
浏览 2
提问于2020-04-17
得票数 1
回答已采纳
2
回答
使用fstream将文件数据从当前位置保存到文件的末尾。
c++
、
file
、
fstream
、
ifstream
other processing of stringstd::string restOfFile{ std::
istreambuf_iterator
<char>{signatureFile},signatureFile.close();
浏览 8
提问于2017-02-13
得票数 0
回答已采纳
1
回答
从std::
istreambuf_iterator
创建std::string,奇怪的语法古怪
c++
、
stl
<char>(file),);std::string contents( std::
istreambuf_iterator
<char, std::char_traits<char> >, std::
istreambuf_i
浏览 0
提问于2014-08-27
得票数 14
回答已采纳
1
回答
为什么在Visual Studio2012中编译
C++
代码时出现错误C2228?
c++
、
visual-studio-2012
当我试图编译这段代码时,我得到了几个错误: vector<char> vsData(
istreambuf_iterator
<char>(vsfile),
istreambuf_iterator
<char
浏览 0
提问于2016-01-15
得票数 0
点击加载更多
相关
资讯
C++ 模板类简介
C+11模板参数简介
自动编程-个性化模板参数
C+11支持函数模板的默认模板参数
python实战1Flask模板参数传值的方法
热门
标签
更多标签
云服务器
对象存储
ICP备案
云点播
腾讯会议
活动推荐
运营活动
广告
关闭
领券