腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(2871)
视频
沙龙
2
回答
为什么
std
::
span
缺少
size_type
?
、
、
我一直在将使用我的自制
span
类的旧代码更新为更符合C++20
std
::
span
的代码,并且我得到了编译错误,因为
std
::
span
没有
size_type
,而是有index_type。关于是否应该签署index_type,有一场巨大的戏剧性事件,但
为什么
要跳过
size_type
呢?这打破了期望容器(或类似容器的对象)具有
size_type
的通用代码。
浏览 16
提问于2019-03-18
得票数 9
回答已采纳
3
回答
mingw编译器错误
、
、
、
然后尝试编译以下代码:#include <vector> typedef
std
::vector<int> Container;typedef
std
::vector<int>iterator iter; <
浏览 1
提问于2011-10-20
得票数 0
回答已采纳
4
回答
我一直收到一个语法错误,但我不确定原因
、
我不知道
为什么
会出现错误C2143:语法错误:
缺少
';‘,如果有人能解释一下我的错误,我将不胜感激。";
std
::cin >> name;//const int rows = pad * 2 + 3;
std
::c
浏览 0
提问于2011-11-08
得票数 2
1
回答
std
::
span
构造函数是否遗漏了noexcept?
、
、
、
根据,
std
::
span
的构造函数(2)定义为explicit(extent !=
std
::dynamic_extent)它的例外被列为2) Throws nothing.如果这个构造函数“没有抛出任何东西”,那么
为什么
它甚至被列在异常下,
为什么
构造函数没有标记为not除外?
浏览 4
提问于2022-11-06
得票数 2
回答已采纳
1
回答
使用
std
::结对类在头文件中错误
、
、
、
size_type
; typedef
std
::pairconst _Kty& x) const; };错误3错误C2238:前面的意外标记;‘ 错误5错误C2238:前面的
浏览 8
提问于2013-01-09
得票数 1
回答已采纳
2
回答
头文件中的ty胡枝子向量
size_type
、
、
我使用的是Visual (不确定这在这里是否相关),我想在头文件中为vector<int>::
size_type
定义typedef。UTILS_H#include <vector> typedef vector<int>::
size_type
\utils.h(8): error C2039: '
size_type
': is not a member of &
浏览 0
提问于2018-09-15
得票数 3
回答已采纳
1
回答
为什么
在函数参数列表中重复typename关键字是必要的?
、
、
我编写了一个玩具程序,它定义了一个模板函数,它以
std
::vector<T>和
std
::vector<T>::
size_type
作为参数。T> v, typename
std
::vector<T>::
size_type
n) { return
std
::vector<T
size_type
时: test.cc:5:54: error: ‘
浏览 5
提问于2015-12-20
得票数 0
回答已采纳
2
回答
对于不同类型的T,是否有一种通用的使用container<T>::
size_type
的方法?
、
假设我有一个带有
std
::vector<bool> a和
std
::vector<int> b字段的类,我希望在构造函数中将其reserve()为一定大小,这对于两个容器来说都是相等的。考虑到reserve()接受
size_type
参数,为了完全安全起见,我必须--据我所理解--使用两个参数编写构造函数,这并不特别吸引人: MyCtor(
std
::vector<bool>::
size_type
size1,
std
::vector<int>::
浏览 2
提问于2017-12-29
得票数 4
1
回答
如何在c++中使用typename?
、
我读过一本名为“C++引物”的书,我不理解以下代码:你能帮我解释一下typename的用法吗
浏览 3
提问于2013-12-19
得票数 2
回答已采纳
1
回答
bad_alloc中的
std
::向量构造函数
、
、
std
::vector有一个构造函数,其中传递
size_type
count的单个参数应该使用count默认构造的元素来调整向量的大小。::vector<Inner> BufContainer; BufContainer bufs1a __n default275 */277
浏览 3
提问于2017-06-30
得票数 13
回答已采纳
2
回答
c++标准在多映射上查找算法
std
::multimap<
size_type
,
size_type
>::iterator it;
std
::multimap<
size_type
,
size_type
>::iterator itup = colToRow.upper_bo
浏览 0
提问于2011-09-04
得票数 0
1
回答
为什么
std
::allocator<>::deallocate()有一个不使用的
size_type
参数?
、
、
使用
std
::allocator时,deallocate函数需要一个pointer参数和一个
size_type
参数(
std
::allocator<>::deallocate(
std
::allocator<>::pointer p,
std
::allocator<>::
size_type
) )。但是,
size_type
是不使用的,也不是可选的。那它
为什么
在那里?它确实让我感到困惑,因为它应该是可选的,甚至不是在那里,因
浏览 4
提问于2014-03-01
得票数 5
回答已采纳
2
回答
模板类无法识别友元运算符
、
、
、
、
class Screen;
std
::ostream& operator<<::string::
size_type
,
std
::string::
size_type
)const; Screen& move(
std
::string::
size_type
浏览 37
提问于2020-07-13
得票数 0
回答已采纳
1
回答
vector<vector<float>>::
size_type
或vector<float>::
size_type
在处理向量<向量<float>的大小()?
、
、
code_1:
std
::vector<
std
::vector<float> >::
size_type
rows = grid.size();code_2:
std
::vector<
std
::vector<float> >
浏览 1
提问于2020-10-12
得票数 0
回答已采纳
1
回答
为什么
std
::set和set::map的默认构造函数需要堆分配?
、
、
、
size_type
; Base a; {
浏览 1
提问于2013-12-29
得票数 3
回答已采纳
2
回答
就地反转字符串
#include <string>#include <iostream>bool compare( const string::
size_type
i, const string::
size_type
j ) cout << "comparing " << i << " and " << j << "
浏览 0
提问于2011-07-10
得票数 0
回答已采纳
2
回答
为什么
我不能像
std
::string::
size_type
那样使用
std
::string::
size_type
呢?(模板参数错误)
、
、
、
、
在我的for循环中声明迭代器时,在研究无符号整数比较警告时, for(QList::
size_type
i = 0; i < uploads.size(); i++) //Do something}error: 'template&
浏览 4
提问于2017-06-22
得票数 4
回答已采纳
1
回答
为什么
text.size()返回
std
::size_t而不是
std
::string::
size_type
、
我正在谈论关于
std
::string的话题。size成员返回字符串的长度。书上写着(第88页)但是Visual代码将len标识为具有
std
::size_t类型
为什么
不一样?
浏览 8
提问于2022-05-27
得票数 1
回答已采纳
1
回答
枚举值作为gsl::multi_
span
的索引
、
、
<char *>(argv, argc);
std
::cout << "Program name: " << args[0] << '\n';
std
::cout << "Parameter: " << args[param_index::PARAM1] &
浏览 15
提问于2017-12-21
得票数 1
回答已采纳
3
回答
如何声明vector::
size_type
的向量?
、
、
我想要一个元素类型为vector::
size_type
的向量vector<vector::
size_type
> aVec;vector<vector<T>::
size_type
> aVec;如果
size_type
刚刚使用了size_t作为它的大小类型(但是没有一个特殊的类型定义,它可能会根据向量所持有的类型而变化),我可以这样
浏览 0
提问于2016-04-08
得票数 3
点击加载更多
相关
资讯
专利分析为什么是不可缺少的?看完你就明白了!
中国黑客六道:网络基础学习篇-获取天气信息
为什么门店不能缺少宫延楼管理系统?它很强大
自学编程为什么少有成功者?大部分人都缺少了这三点!
为什么中国人一定做不好区块链项目?根本原因是中国缺少……
热门
标签
更多标签
云服务器
ICP备案
对象存储
云点播
实时音视频
活动推荐
运营活动
广告
关闭
领券