Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
将 unique_ptr 与 boost python 结合使用 - boost::shared_ptr 有效,但 unique_ptr 无效
这可能与以下问题相同 Boost Python 没有 to python for std unique ptr https stackoverflow com questions 20590205 boost python no to py
python
c
boost
boostpython
uniqueptr
没有适当的默认构造函数可用于 std::unique_ptr
这是我上一篇文章的延续 由于它已经关闭 我决定发表新帖子 我删除了一半的代码以使其更具可读性 我读过的一些帖子 使用 SDL 的智能指针 https stackoverflow com questions 24251747 smart po
c
SDL
uniqueptr
具有基类的唯一 ptr 的类的复制构造函数[重复]
这个问题在这里已经有答案了 当一个类具有基类的 unique ptr 时 实现复制构造函数的好方法是什么 让我尝试用一 个例子来解释它 struct Base virtual void doSth 0 to make the class a
c
uniqueptr
使用 std::unique_ptr
& 代替 std::unique_ptr
有什么优点吗?
使用有什么好处吗std unique ptr
c
uniqueptr
如何使用唯一指针向量?
I use vector
c
uniqueptr
查找 unique_ptr 集合的原始指针
我经常发现自己想要编写这样的代码 class MyClass public void addObject std unique ptr newObject void removeObject const Object target priv
c
C11
uniqueptr
c14
为什么 unique_ptr
不能从 T* 构造?
举个简单的例子 这段代码有什么 问题 unique ptr
c
uniqueptr
使用 unique_ptr 的 value_type 构造 unordered_map
这段代码似乎不起作用 因为唯一的指针被存储到一个pair对象中 然后尝试从中复制 这可以避免吗 std unordered map
c
C11
c14
uniqueptr
unorderedmap
移动 unique_ptr 后 std::unique_ptr::get 返回的值是否有效?
考虑以下代码片段 class Owner public Owner std unique ptr
C11
move
uniqueptr
unique_ptr 的初始化有什么问题?
有人可以告诉我 以下 unique ptr 初始化有什么问题吗 int main unique ptr
c
C11
initialization
uniqueptr
unique_ptr 和 OpenSSL 的 STACK_OF(X509)*
我用一些using声明和unique ptr与 OpenSSL 一起使用 如在另一个问题中建议 https stackoverflow com a 38079093 608639 如果没有 代码会变得非常丑陋 而且我不太喜欢 goto 语句
c
C11
openssl
smartpointers
uniqueptr
为什么可以在没有 std::move 的情况下返回 std::unique_ptr ?
unique ptr
c
C11
uniqueptr
movesemantics
unique_ptr自定义存储类型示例?
霍华德 希南特 解释了 http home roadrunner com hinnant unique ptr03 html that unique ptr还可以使用自定义存储类型 他举了一个例子 共享内存 他只给出了粗略的想法 这对于快速
C11
uniqueptr
应该使用 unique_ptr 来更轻松地实现“移动”语义吗?
Edit made Foo and Bar稍微不那么琐碎 直接替换为shared ptr lt gt 更加困难 Should unique ptr lt gt 用作实现移动语义的更简单方法 对于像这样的课程 class Foo int m
c
C11
movesemantics
uniqueptr
为什么不允许`make_unique
`?
Assume namespace std throughout C 14 委员会草案 N3690 定义std make unique thus n3690 20 9 1 4 unique ptr创建 unique ptr create te
c
languagelawyer
uniqueptr
c14
std::make_unique 和 std::unique_ptr 与 new 之间的差异
Does std make unique有任何效率优势 例如std make shared 与手动构建相比std unique ptr std make unique
c
C11
c14
smartpointers
uniqueptr
如何将 unique_ptr 的向量声明为类数据成员?
我想要一个 unique ptr 的向量作为我正在创建的类的成员 class Foo private vector
c
visualstudio2010
vector
uniqueptr
来自同一原始指针的 C++ 多个唯一指针
考虑下面我的代码 我对唯一指针的理解是 只能使用一个唯一指针来引用一个变量或对象 在我的代码中 我有多个 unique ptr 访问同一变量 这显然不是我所知道的使用智能指针的正确方法 因为指针应该从创建时就拥有完整的所有权 但是 为什么这
c
C11
pointers
uniqueptr
`unique_ptr< T const [] >` 应该接受 `T*` 构造函数参数吗?
Code include
c
C11
standards
uniqueptr
为什么 unique_ptr::release 没有用 [[nodiscard]] 定义?
C 17 added nodiscard https en cppreference com w cpp language attributes nodiscard C 20添加了使用 nodiscard on empty方法 例如vect
c
uniqueptr
nodiscard
1
2
3
4
5
6
»