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?
|