Using the [unsafe] attribute, it is possible to store the interface without reference counting.

Using the [unsafe] attribute, it is possible to store the interface without reference counting.
Is there any way for this behavior to be "transferred" to the collection, e.g.

List: IList ;

something like:

List: IList <[unsafe] IBaseInterface>;

?

Comments

  1. Do you see the sense of using the [unsafe] attribute?

    ReplyDelete
  2. Yes, for something shortlived (like a local variable) or a result in some interface based fluent API because one can be sure that this reference lives shorter than what it refers to and thus you can omit the reference counting. However a list typically holds things longer, especially since you wrote IList (which I suspect to be a spring4d collection)

    ReplyDelete
  3. You can use list of pointers if you want to have unsafe list of anything.

    ReplyDelete

Post a Comment