Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
在运行时有条件地实例化模板
我有一个模板类 template
c
templates
smartpointers
引用计数指针的STL类?
这应该是微不足道的 但我似乎找不到它 除非不存在这样的类 智能指针的 STL 类 或类集 是什么 UPDATE 感谢您的回复 我必须说我很惊讶没有标准实施 我最终使用了这个 http archive gamedev net referenc
c
STL
smartpointers
referencecounting
C++“智能指针”模板,自动转换为裸指针,但无法显式删除
我正在一个非常大的遗留 C 代码库中工作 该代码库将保持匿名 作为遗留代码库 它在各处传递原始指针 但我们正在逐渐尝试使其现代化 因此也有一些智能指针模板 这些智能指针 与 Boost 的scoped ptr 不同 具有到原始指针的隐式转换
c
templates
smartpointers
与智能指针的返回类型协方差
在 C 中我们可以这样做 struct Base virtual Base Clone const virtual Base struct Derived Base virtual Derived Clone const overrides
c
smartpointers
virtualfunctions
returntype
是否存在具有单个强所有者和多个弱引用的共享指针?
我正在寻找类似于的智能指针Arc Rc只不过它不允许共享所有权 我想要尽可能多的rc Weak我需要的参考资料 但我只想one强引用 又称所有者 我想通过类型系统来强制执行这一点 Arc Rc可以克隆 并且可以在多个地方拥有它们 滚动我自己
Rust
smartpointers
为什么unique_ptr
::~unique_ptr需要T的定义?
如果我有一堂 酒吧 课 bar h class Bar public Bar 我转发声明与另一个类 Foo 中的 std unique ptr 一起使用 foo h include
c
C11
std
smartpointers
惯用使用 std::auto_ptr 还是只使用shared_ptr?
现在shared ptr是在 tr1 中 你认为使用应该会发生什么std auto ptr 它们都有不同的用例 但所有用例auto ptr可以用以下方法解决shared ptr 也 你会放弃吗auto ptr或者在您想明确表示在任何给定点只
c
codingstyle
smartpointers
tr1
如何以 const 形式返回指向指针列表的私有指针?
我有一个指向指针列表的指针 作为私有变量 我还有一个 getter 它返回指向列表的指针 我需要保护它免受更改 我找不到如何使用reinterpret cast 或const cast 对此 class typeA shared ptr
c
constants
smartpointers
privatemembers
containerdatatype
使用shared_ptr的例子?
你好 我今天问了一个关于如何在同一个向量数组中插入不同类型的对象 https stackoverflow com questions 3475030 different types of objects in the same vector
c
boost
vector
sharedptr
smartpointers
unique_ptr 和 OpenSSL 的 STACK_OF(X509)*
我用一些using声明和unique ptr与 OpenSSL 一起使用 如在另一个问题中建议 https stackoverflow com a 38079093 608639 如果没有 代码会变得非常丑陋 而且我不太喜欢 goto 语句
c
C11
openssl
smartpointers
uniqueptr
“由于在生成器中使用而发生移动”错误是什么意思?
我遇到了关于生成器的问题 use tokio runtime Runtime use tokio task JoinHandle use std sync Arc pub fn run f Box
Rust
smartpointers
movesemantics
是否有 C++/CLI 智能指针项目(例如scoped_ptr)?
是否有 C CLI RAII 智能指针类用于在托管类型中包含本机指针 只是想知道 在我自己写之前clr scoped ptr值类模板 我知道微软提供的 本机类中托管句柄的包含 auto gcroot http msdn microsoft
CCLI
smartpointers
是否应该始终使用 boost::ptr_vector 代替 std::vector ?
这只是我遇到的一个概念性问题 在我当前的项目中 感觉我过度使用了 boostsmart ptr and ptr container图书馆 我正在创造boost ptr vectors在许多不同的对象中 并调用 Transfer 方法从一个对
c
boost
vector
smartpointers
即使使用智能指针,C++ 在发生异常时也会泄漏
我是智能指针世界的新手 我已经阅读完毕 他们都指出 即使程序在遇到异常后退出 智能指针也可以避免内存泄漏 我写了一个简单的程序来尝试一下 但是Valgrind http en wikipedia org wiki Valgrind告诉我我的
c
memoryleaks
smartpointers
C++ 多重继承和向上转换的智能指针破坏导致 VS 2017 中的堆损坏
我在使用上面的代码时遇到了 VS 调试器的问题 class Animal public class Stupid public class Dog public Stupid public Animal public int main st
c
inheritance
smartpointers
heapcorruption
如何使用 Arc 和 Weak 创建循环引用?
我有两个结构 struct A map HashMap
reference
Rust
smartpointers
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
混合 C++ 和 Objective-C
我使用 C 作为应用程序主干 使用 Objective C 作为 GUI 这很好 但是当谈到在 Objective C mm 文件 中将这些代码混合在一起时 我有几个问题 1 我可以将 STL 容器与 Objective C 或 Cocos
c
Objectivec
boost
cocos2diphone
smartpointers
为什么 Arc::try_unwrap() 会导致恐慌?
我正在编写一个简单的聊天服务器 它向所有连接的客户端广播消息 由于我是初学者 代码可能看起来很糟糕 对等点尚未在任何地方使用 因为我想将其传递给handle client函数也是如此 因此当数据在流中可用并成功读取时 我想在所有连接的客户端
errorhandling
Rust
smartpointers
referencecounting
托管 C++/CLI 类中的 auto_ptr 或 shared_ptr 等效项
在 C CLI 中 您可以在托管类中使用本机类型 因为不允许在托管类中保存本机类的成员 在这种情况下您需要使用指针 这是一个例子 class NativeClass public ref class ManagedClass private
CCLI
smartpointers
autoptr
1
2
3
4
5
»