> From reading your posts, I am a little confused. Are you saying you
> are working on a library that will have containers that are 'similar' to
[quoted text clipped - 10 lines]
>
> where {namespace} and {vector_class} are yet to be announced?

Signature
Tomas Restrepo
tomasr@mvps.org
Tomas Restrepo (MVP) wrote:
> Potentially, both. The second scenario is what they are trying to enable for
> Whidbey, but the first one, which would support full type unification
> (managed and unmanaged mixed seamlessly) is something they are looking at
> post-whidbey
>
> I hope I got it right, Ronald ;)
This was my understanding of Ronald's statements.
I wonder if the intermediate step is worth the effort? Personally, I'd
rather use
std::vector<gcroot<Button^> > rather than a new class even if the
'interface' is common.
I'm already used to using
std::vector<boost::shared_ptr<Class> > all over the place anyway so an
intermediate step of a different library doesn't seem worth the hassle
for me.
Are there any performance/hidden advantages to the intermediate solution
over using gcroot?
Thanks
Russell
Tomas Restrepo \(MVP\) - 08 Jul 2004 02:29 GMT
Hi Russell,
> This was my understanding of Ronald's statements.
>
> I wonder if the intermediate step is worth the effort? Personally, I'd
> rather use std::vector<gcroot<Button^> > rather than a new class even if
the
> 'interface' is common.
Well, I believe it could be. I'm not sure exactly what the new library would
contain, but one could fairly safely assumme that it would be highly tuned
towards providing correct supports for several .NET specific idioms and
programming issues... that is, consider things like the GC model, value vs.
reference types, resource-management (IDiposable support) and so on....

Signature
Tomas Restrepo
tomasr@mvps.org
Russell Hind - 08 Jul 2004 09:11 GMT
Tomas Restrepo (MVP) wrote:
> Well, I believe it could be. I'm not sure exactly what the new library would
> contain, but one could fairly safely assumme that it would be highly tuned
> towards providing correct supports for several .NET specific idioms and
> programming issues... that is, consider things like the GC model, value vs.
> reference types, resource-management (IDiposable support) and so on....
I guess the IDisposable would be a big winner for cleanup. I'd
forgotten about that as I'm fairly new to managed stuff (coming from
Borland's VCL).
Thanks
Russell
Ronald Laeremans [MSFT] - 08 Jul 2004 13:31 GMT
You should not consider that an intermediate step. Even with full type
unification, objects that don't cross the boundary (between GC collected and
native) will have significantly superior performance than mixed objects (or
mixing the type of the collection with the type of contained object).
We cannot do magic, both worlds still play by separate rules. E.g. a mixed
type will have a separate managed and native part and pointers going both
ways. Creating an instance will require both a gc heap allocation and a C++
heap allocation. For std::containers, the overhead of a handle for each
contained object and the indirection through the handle for each operation
on an element is also not free.
We definitely could not fit the full unification support in the current
release, but apart from that, the fact that we will have significant amount
of real world code written both by external VC customers and inside
Microsoft will significantly benefit the eventual implementation of the
unification support and a good understanding of when it will be appropriate
to use which features. Of course premature optimization is never worthwhile,
but an understanding that some of the support will have associated costs
will still be essential IMO.
Specifically for our managed object implementation of STL type collections,
we expect it to be extremely close to the C++ standard, however there are a
few requirements on the std::collections that could not be met (or could not
be met in an implementation where other things like performance and perhaps
even verifiability are also priorities). I do think that supporting the
containers, iterators, algorithms style collections for .net types in an
ideal way is gong to add significant value.
I hope this post also addresses Ioannis' comments later in the thread.
Ronald
> Tomas Restrepo (MVP) wrote:
>>
[quoted text clipped - 26 lines]
>
> Russell
Ioannis Vranos - 08 Jul 2004 13:54 GMT
> You should not consider that an intermediate step. Even with full type
> unification, objects that don't cross the boundary (between GC collected and
[quoted text clipped - 26 lines]
>
> I hope this post also addresses Ioannis' comments later in the thread.
That is a good approach indeed. However, for STL facilities which will
not be implemented yet to support handles explicitly, making the
compiler to understand that when ^ is met in a template instantiation,
to use gcroot implicitly, instead of requiring us to write that ugly
stuff would be a significant improvement (and a simple thing I think).
Regards,
Ioannis Vranos
Tomas Restrepo (MVP) wrote:
>>std::vector<Button^> MyVector
>>
[quoted text clipped - 10 lines]
>
> I hope I got it right, Ronald ;)
But the second has not anything to do with the C++ standard library, and
we talking about standard library containers and algorithms working with
handles (at least).
Regards,
Ioannis Vranos