Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
右值参考还是左值?
我有一个类似性质的问题 就像 5 年前发布的问题一样 为什么右值引用变量不是右值 https stackoverflow com questions 32620750 why are rvalues references variables
c
rvaluereference
C++11 右值引用也调用复制构造函数
我一直在测试一些 C 11 功能 我遇到了右值引用和移动构造函数 我实现了我的第一个移动构造函数 如下 include
c
C11
rvaluereference
moveconstructor
std::forward 是否有带有纯右值的用例?
最常见的用法是std forward是为了完善转发转发 通用 参考 例如 template
c
C11
movesemantics
rvaluereference
为什么 `std::stringstream::stringstream(std::string&&)` 不存在?
我希望stringstream有一个构造函数从 a 中窃取其初始内容string STL中一般不存在这种跨物种的 移动构造函数 吗 如果没有 为什么不呢 有历史 令人失望 但也有一个看起来光明的未来 当移动语义进入 C 11 时 它是巨大的
c
C17
movesemantics
stringstream
rvaluereference
C++11 中的“三法则”变成了“五法则”? [关闭]
Closed 这个问题是基于意见的 help closed questions 目前不接受答案 所以 看完之后这次精彩的讲座 http channel9 msdn com shows Going Deep C9 Lectures Intro
c
constructor
C11
rvaluereference
ruleofthree
具有右值参数调用的 C++11 模板化函数
在某些 O 类中 我有模板化函数test2 struct A int value struct O A value template
c
templates
C11
rvaluereference
std::is_same 结果与左值和右值引用
我正在将 std is same 实用程序函数与右值和左值引用结合使用 并遇到了奇怪的行为 考虑这个检查变量 t 类型的函数模板 我正在使用 VS 2013 struct Test template lt class T gt void h
c
C11
rvaluereference
decltype
为什么局部变量的常量性会抑制返回值的移动语义?
struct STest public boost noncopyable STest STest test m n std move test m n explicit STest int n m n n int m n STest Fu
C11
Return
constants
movesemantics
rvaluereference
重载算术中的移动语义和右值引用传递
我正在用 C 编写一个小型数值分析库 我一直在尝试使用最新的 C 11 功能 包括移动语义 来实现 我理解以下帖子中的讨论和最佳答案 C 11 右值和移动语义混淆 return 语句 https stackoverflow com ques
c
C11
rvaluereference
movesemantics
数组和右值(作为参数)
我想知道是否有任何方法可以区分以下代码中显示的函数调用 以数组作为参数 include
c
Arrays
C11
rvaluereference
rvalue
我在这里使用 std::forward 还是 std::move ?
假设我有 template
c
C11
movesemantics
rvaluereference
在可移动和不可复制的类上使用移动和交换习惯是否有意义
如果我有这样的课程 class Foo public Foo Foo Foo rhs operator Foo rhs swap this rhs void swap Foo rhs private Foo const Foo snip s
c
C11
assignmentoperator
rvaluereference
copyandswap
移动构造函数应该采用 const 或非 const 右值引用吗?
在几个地方 我看到了复制和移动构造函数的推荐签名 如下所示 struct T T T const T other T T other 其中复制构造函数采用 const 引用 而移动构造函数采用非 const 右值引用 据我所知 这阻止了我在
c
C11
rvaluereference
moveconstructor
C++11 lambda 可以分配给带有错误签名的 std::function
以下代码编译并运行 在 Apple LLVM 版本 6 1 0 和 Visual C 2015 下 include
c
C11
Lambda
rvaluereference
来自右值的非常量类型引用
考虑以下代码 class Widget template
c
templates
C11
rvaluereference
右值引用的对象内部的对象也是右值引用的吗?
右值引用的对象内部的对象也是右值引用的吗 struct A struct B A a2 template
c
C11
rvaluereference
通过 std::bind 传递右值
我想传递一个右值std bind到 C 0x 中采用右值引用的函数 我不知道该怎么做 例如 include
c
C11
std
rvaluereference
rvalue
函数内的右值引用参数的类型是什么? [复制]
这个问题在这里已经有答案了 我这里有一个非常简单的函数定义 void testRvalue int r printf rvalue ref is called n testRvalue r this line gives no known
c
C11
rvaluereference
我通常/总是可以使用 std::forward 而不是 std::move 吗?
我一直在看斯科特 迈耶斯的谈论通用参考来自 C and Beyond 2012 会议 到目前为止一切都有意义 然而 在50分钟左右 一位观众问了一个我也想知道的问题 迈耶斯说他并不关心答案 因为这不符合惯用语 而且会让他的头脑变得愚蠢 但我
c
C11
movesemantics
rvaluereference
perfectforwarding
T&&(双与号)在 C++11 中意味着什么?
我一直在研究 C 11 的一些新功能 我注意到的一个是声明变量时的双 符号 例如T var 首先 这个野兽叫什么 我希望谷歌允许我们像这样搜索标点符号 它到底有什么作用mean 乍一看 它似乎是一个双重引用 就像C风格的双指针一样 T va
c
C11
rvaluereference
cfaq
perfectforwarding
«
1
2
3
4
5
»