由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - is smart_ptr really that good?
相关主题
c++ 里用到pointer 的地方我们尽可能用smart pointer吗?pointer overflow
请问:Auto_Ptr、Smart Ptr 和 Reference Counting是什么关系? (转载)C++ Q05: pointer to constant variable
c++ interview: iterator 和 pointer区别?C++ Q93 - Q95 (转载)
关于不同类型的smart pointerint F::*x = &F::x是什么意思?
C++的smart pointer注定是个二流的东西不如各位高手挑个专题讲讲C++11吧
琢磨了一下c++ smart pointer,发现不能到处用Go adopts JavaScript’s idea of semicolon insertion
什么时候使用c++ smart pointer?smart pointer 一问
Why do I need to use "plain" pointer?stl的interator是一种smart pointer吗
相关话题的讨论汇总
话题: smart话题: pointers话题: ptr话题: pointer话题: really
进入Programming版参与讨论
1 (共1页)
mw
发帖数: 525
1
hi,
Today the Tech Lead in the team told me that he want to re-write all the
bare pointers to smart ptr
for me this is kinda insane, taken into account that the extensive usage of
c++ pointers in our existing code.
my question is:
Is smart pointer really that good? we are working on an ultra-high intensity
TCPIP IO software, I cannot understand what's the benefit of smart pointer
here.
can any guru here share his/her opinion?
thanks a lot
o**o
发帖数: 3964
2
follow the lead. try other ways after you become the lead.

of
intensity
pointer

【在 mw 的大作中提到】
: hi,
: Today the Tech Lead in the team told me that he want to re-write all the
: bare pointers to smart ptr
: for me this is kinda insane, taken into account that the extensive usage of
: c++ pointers in our existing code.
: my question is:
: Is smart pointer really that good? we are working on an ultra-high intensity
: TCPIP IO software, I cannot understand what's the benefit of smart pointer
: here.
: can any guru here share his/her opinion?

h*******e
发帖数: 225
3
it really depends on what you are doing. there are different kinds of smart
pointers, each with its own characteristics. it is not as simple as putting
everything in <> and you are done. To make best use of the smart pointers
you have to understand what they do, otherwise it will introduce other bugs(
like concurrency bugs) that are more subtle to discover and debug than
memory leakage or out-of-bounds access.
in short, you have to know what you are dealing with and how it works before
you can r

【在 mw 的大作中提到】
: hi,
: Today the Tech Lead in the team told me that he want to re-write all the
: bare pointers to smart ptr
: for me this is kinda insane, taken into account that the extensive usage of
: c++ pointers in our existing code.
: my question is:
: Is smart pointer really that good? we are working on an ultra-high intensity
: TCPIP IO software, I cannot understand what's the benefit of smart pointer
: here.
: can any guru here share his/her opinion?

l********g
发帖数: 134
4
such *_ptr just imposes another coding convention on programmers, I don't
think it's wise or making economic sense to do it when you have tons of code
bases.

smart
putting
bugs(
before

【在 h*******e 的大作中提到】
: it really depends on what you are doing. there are different kinds of smart
: pointers, each with its own characteristics. it is not as simple as putting
: everything in <> and you are done. To make best use of the smart pointers
: you have to understand what they do, otherwise it will introduce other bugs(
: like concurrency bugs) that are more subtle to discover and debug than
: memory leakage or out-of-bounds access.
: in short, you have to know what you are dealing with and how it works before
: you can r

l*****d
发帖数: 359
5
use objects (such as smart pointers) to manage the resources, so that you
don't worry about issues such as memory leakage because you forget to delete
dynamically allocated resources or can't due to for example a pre-mature
termination of a function.
O*******d
发帖数: 20343
6
每一个delete都是潜在的危险。 最好不用。 让object去自动处理。我写的code基本上
没有delete。
B********e
发帖数: 1062
7
The Tech Lead sucks.
Check Exceptional C++ Item 37.
I will use smart pointers when:
1) pimpl idiom
2) exception safe requirement is very high.
3) some global last for ever objects
Other than that, I don't like using them.

of
intensity
pointer

【在 mw 的大作中提到】
: hi,
: Today the Tech Lead in the team told me that he want to re-write all the
: bare pointers to smart ptr
: for me this is kinda insane, taken into account that the extensive usage of
: c++ pointers in our existing code.
: my question is:
: Is smart pointer really that good? we are working on an ultra-high intensity
: TCPIP IO software, I cannot understand what's the benefit of smart pointer
: here.
: can any guru here share his/her opinion?

x****u
发帖数: 44466
8
一般来说无故修改正确运行的代码是大忌。

of
intensity
pointer

【在 mw 的大作中提到】
: hi,
: Today the Tech Lead in the team told me that he want to re-write all the
: bare pointers to smart ptr
: for me this is kinda insane, taken into account that the extensive usage of
: c++ pointers in our existing code.
: my question is:
: Is smart pointer really that good? we are working on an ultra-high intensity
: TCPIP IO software, I cannot understand what's the benefit of smart pointer
: here.
: can any guru here share his/her opinion?

1 (共1页)
进入Programming版参与讨论
相关主题
stl的interator是一种smart pointer吗C++的smart pointer注定是个二流的东西
Smart Pointer琢磨了一下c++ smart pointer,发现不能到处用
关于多个smart pointer系统并存的问题什么时候使用c++ smart pointer?
一个简单的小问题Why do I need to use "plain" pointer?
c++ 里用到pointer 的地方我们尽可能用smart pointer吗?pointer overflow
请问:Auto_Ptr、Smart Ptr 和 Reference Counting是什么关系? (转载)C++ Q05: pointer to constant variable
c++ interview: iterator 和 pointer区别?C++ Q93 - Q95 (转载)
关于不同类型的smart pointerint F::*x = &F::x是什么意思?
相关话题的讨论汇总
话题: smart话题: pointers话题: ptr话题: pointer话题: really