Oops, I used the wrong reply-to address in the below reply. This message has
a correct one. Sorry about that.
--
Derrick Coetzee, Microsoft Speech Server developer
This posting is provided "AS IS" with no warranties, and confers no rights.
"Derrick Coetzee [MSFT]" <noreply@microsoft.invalid> wrote in message
news:Ozaaii39EHA.2180@TK2MSFTNGP10.phx.gbl...[color=blue]
> "NotABug" <NotABug@discussions.microsoft.com> wrote:[color=green][color=darkred]
> > > > Is it possible to do collections of struct __values in MC++ 2003?
> > >
> > > see __box( )[/color]
> >
> > Thanks. But I think that would create a lot of overhead no?
> > For any manipulation, the structure seems to be copied bytewise in and[/color][/color]
out[color=blue][color=green]
> > of the CLR memory..... but maybe is the only way...
> >
> > What would be the best way in terms of performance for storing big[/color]
> collections[color=green]
> > of small data structures in Managed C++, like Colors or Points?[/color]
>
> If you wish to expose a collection of value types to other .NET
> applications, you have two choices:
>
> 1. Use an array. Arrays of value types use internal storage, and so are[/color]
more[color=blue]
> space- and time-efficient for small types. To learn more about this[/color]
option,[color=blue]
> take a look at
>[/color]
http://msdn.microsoft.com/library/de...et6_update.asp[color=blue]
>
> 2. Use boxing, as Carl suggested. For more complex data structures, the
> overhead of the data structure may exceed the overhead of the boxing in[/color]
any[color=blue]
> case.
>
> On the other hand, if the collection is entirely internal to your
> application, you'll probably get the best performance out of STL[/color]
containers,[color=blue]
> which specialize their implementations to your value types. You could even
> wrap an STL container in a public managed class to form a restricted
> interface to your collection for other .NET applications.
>
> If none of these approaches seem to apply to you, could you give some more
> information about your specific situation, such as the type of container[/color]
you[color=blue]
> need and whether you intend to share it? I hope this helps.
> --
> Derrick Coetzee, Microsoft Speech Server developer
> This posting is provided "AS IS" with no warranties, and confers no[/color]
rights.[color=blue]
> Use of included code samples are subject to the terms specified at
>
http://www.microsoft.com/info/cpyright.htm[/color]