Re: type safe issue
Sorry Igor,
English is not my native language.
I think you mean the solution I posted can solve type safe issue to some
extent, but not solving all issues, for example, this is the issue you
pointed,
Well, if you are hell-bent on breaking this solution, you can of course
write
IComPtr<IY, &IID_IZ> p;
p.CreateInstance(...);
and using CComPtr smart pointer can solve the issue mentioned above,
template <typename I, IID* iid = &__uuidof(I)>
class CComPtr {...};
Correct?
regards,
George
"Igor Tandetnik" wrote:
"George" <George@discussions.microsoft.com> wrote in message
news:CB15EE63-9A31-4107-BD96-4E133DE8A4D6@microsoft.com
1. [my understanding of solution] How do you think of my
understanding of why the solution solves type safe issue I described
above in my original question? Correct?
No idea. I didn't understand what you were trying to say, no offense
intended.
2. [solution itself] How do you think of the solution I posted above
to solve the type safe issue? Correct solution?
I'm not sure what the definition of "correct" is here. Unbreakable? No,
you can still introduce a mismatch on purpose. Useful in practice? Yes,
it is.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925