小编lsb*_*bbo的帖子

为什么T不会推断为int && here

以下是功能模板

template <class T>
void func(T&& t) {
}

func(4); // 4 is rvalue and T deduces to int
Run Code Online (Sandbox Code Playgroud)

所以我的问题是为什么T不推导到int &&?

我的意思是,如果T推断为int &&

所以int && && - > int &&这对我来说也是有意义的!

c++ templates rvalue

3
推荐指数
2
解决办法
97
查看次数

当输入尺寸较小时,为什么插入排序比快速排序更快?

我想得到的理论原因不是实验结果.另外,我们如何确定数据大小何时被调用为小或大?

我没有解释清楚,我的意思是当输入数据大小很小时,我们通常选择使用插入排序或不使用快速排序,这是正确的.所以我想知道为什么会这样?

sorting algorithm

2
推荐指数
1
解决办法
3130
查看次数

标签 统计

algorithm ×1

c++ ×1

rvalue ×1

sorting ×1

templates ×1