r*******n 发帖数: 3020 | |
m*******l 发帖数: 12782 | 2 no pointer is the best pointer
【在 r*******n 的大作中提到】 : rt
|
r*******n 发帖数: 3020 | 3 seriously?
C++里不能避免用pointer吧
【在 m*******l 的大作中提到】 : no pointer is the best pointer
|
m*******l 发帖数: 12782 | 4 just avoid them as possible as you can
【在 r*******n 的大作中提到】 : seriously? : C++里不能避免用pointer吧
|
N*****m 发帖数: 42603 | 5 至少我们公司是这样的
【在 r*******n 的大作中提到】 : rt
|
m*******l 发帖数: 12782 | 6 问题是这个什么东西啊,一哪个啥就容易滥用...
【在 N*****m 的大作中提到】 : 至少我们公司是这样的
|
N*****m 发帖数: 42603 | 7 当然是该用的时候才用
【在 m*******l 的大作中提到】 : 问题是这个什么东西啊,一哪个啥就容易滥用...
|
d**********x 发帖数: 4083 | 8 尽量用成熟的库或者山寨成熟的库吧,要不然线程安全问题就够喝一壶的了
【在 r*******n 的大作中提到】 : rt
|
m*******l 发帖数: 12782 | 9 老大,这时另外一个话题了
【在 d**********x 的大作中提到】 : 尽量用成熟的库或者山寨成熟的库吧,要不然线程安全问题就够喝一壶的了
|
n******t 发帖数: 4406 | 10 我个人认为最好不要用smartptr.
如果你掉的库要用,你就用。
【在 r*******n 的大作中提到】 : rt
|
|
|
g****u 发帖数: 252 | 11 最好不用pointer.
【在 r*******n 的大作中提到】 : rt
|
d**********x 发帖数: 4083 | 12 = =
【在 m*******l 的大作中提到】 : 老大,这时另外一个话题了
|
d**********x 发帖数: 4083 | 13 恩,要用的话就是整个项目都用
否则就小心为上
【在 n******t 的大作中提到】 : 我个人认为最好不要用smartptr. : 如果你掉的库要用,你就用。
|
s*********t 发帖数: 1663 | 14 完全取决于关于lifetime的contract
【在 r*******n 的大作中提到】 : rt
|
f******y 发帖数: 2971 | 15 thread local storage可以解决,gcc早就支持c版本的了。4.8以后要支持c++11版本的
了。
【在 d**********x 的大作中提到】 : 尽量用成熟的库或者山寨成熟的库吧,要不然线程安全问题就够喝一壶的了
|
b*******s 发帖数: 5216 | 16 try boost's smart pointers
【在 r*******n 的大作中提到】 : rt
|
d****i 发帖数: 4809 | 17 Are you kidding? C++ program without pointers will not be called C++ at all.
It is the bare metal thing that makes pointers so much fun and so much
fascinating.
【在 g****u 的大作中提到】 : 最好不用pointer.
|
a***n 发帖数: 538 | 18 boost的shared pointer很慢,前一段时间profile一个程序,shared pointer的计数器
用了5%的cpu。 |
O*******d 发帖数: 20343 | 19 我是一般情况下,尽量用smart pointer。 在一些高强度的循环中,把raw pointer从
smart pointer中调出来,直接用。这样可以避免smart pointer的overhead。 我的原
则是,用smart pointer来管理memory,尽量不用delete。 我写的code中,几乎没有
delete。 |