Why not to use Smart types in a container?
-
Some coding standards at my end says that, Do not use smart types in a container? Does anyone know reason for this?
-
Some coding standards at my end says that, Do not use smart types in a container? Does anyone know reason for this?
Any extra things that one has to consider while using this?
-
Any extra things that one has to consider while using this?
-
When copying container
auto_ptr
will incur problems. No problem withshared_ptr
. I'm usingshared_ptr
in a vector now. :)system
Thanks for the answer. but my other question is e.g. what care needs to be taken if i use _bstr_t in a vector?
-
Thanks for the answer. but my other question is e.g. what care needs to be taken if i use _bstr_t in a vector?
_bstr_t is like shared_ptr, it can be copied, but there is a problem about the semantic: For example, 1. let vecotr a contain some _bstr_t pointers, 2. copy a to b 3. get some pointer in b, and changed the object through the pointer, think what about a. I think it is not the semantic of copy.
system