473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

deterministic destruction support for managed types in VC++ 2005beta 1

Do ref classes indeed support instantiation on the stack? Similarly, can
native classes be instantiated on gc heap?

When you try to have a ref class instance on the stack, you'll get:

R : cannot use this type here without a top-level '^'.

When you try to instantiate a native class using gcnew using Visual
Studio 2005 Beta 1, you'll get:

error C2726: 'gcnew' may only be used to create an object with managed type.

I was going through the C++/CLI Language Specification Working Draft
1.5, Jun, 2004, and nowhere I could find a clause that would make me
believe that managed types are allowed to go on the stack or native heap.

I've read articles, such as this one
http://www.codeguru.com/Csharp/.NET/...cle.php/c7405/

that makes all sorts of claims regarding support for deterministic
destruction for managed types. Where is it mentioned in the C++/CLI draft?

Regards,
Slawomir Lisznianski [ www.rhapsodia.org ]

Nov 17 '05 #1
2 1260
Slawomir Lisznianski wrote:
Do ref classes indeed support instantiation on the stack? Similarly,
can
native classes be instantiated on gc heap?

When you try to have a ref class instance on the stack, you'll get:

R : cannot use this type here without a top-level '^'.

When you try to instantiate a native class using gcnew using Visual
Studio 2005 Beta 1, you'll get:

error C2726: 'gcnew' may only be used to create an object with
managed type.

I was going through the C++/CLI Language Specification Working Draft
1.5, Jun, 2004, and nowhere I could find a clause that would make me
believe that managed types are allowed to go on the stack or native
heap.

I've read articles, such as this one
http://www.codeguru.com/Csharp/.NET/...cle.php/c7405/
that makes all sorts of claims regarding support for deterministic
destruction for managed types. Where is it mentioned in the C++/CLI
draft?


VC++ 2005 will support GC types on the stack, but that support is not in
Beta-1. I don't know about native types on the GC heap. I believe that's
in the long-term plan (complete unification of the GC/native type system),
but I'm not sure if it's in the 2005 compiler or not.

-cd
Nov 17 '05 #2
Carl Daniel [VC++ MVP] wrote:
VC++ 2005 will support GC types on the stack, but that support is not in
Beta-1. I don't know about native types on the GC heap. I believe that's
in the long-term plan (complete unification of the GC/native type system),
but I'm not sure if it's in the 2005 compiler or not.


Unfortunately, creating native classes with gcnew did not make it into the
Visual C++ 2005 release. It's one of the top features for the next major
release of Visual C++.

--
Brandon Bray, Visual C++ Compiler http://blogs.msdn.com/branbray/
This posting is provided AS IS with no warranties, and confers no rights.
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Bredal Jensen | last post by:
I want to port my MFC (VC++6) application to manageg VC ++. 7. I want to do this because some things are much better done with C#. So i could write a C# class and use in my VC++ code as Languague...
10
by: Gary Hughes | last post by:
I'm getting the following error when attempting to link a managed C++ dll. I can't find any reference to these errors with google. Can anyone help? I've included the class definition causing the...
5
by: Alan Cobb | last post by:
Hi, In the managed C++ class below I get compile warning C4677 from VS2003. "signature of non-private function contains assembly private type", even though the managed enum is public. I have...
3
by: zhphust | last post by:
I want to convert a object of a managed class to a unmanaged structure that has the same member with that managed class. Can anybody tell me how i can do it? Thanks in advance. -- zhphust...
4
by: William F. Kinsley | last post by:
My understanding is that when I re-compile a existing MFC application with the /clr switch, that the code generated is managed(with some exceptions) but that the data isn't, i.e. not garbage...
11
by: Peter Oliphant | last post by:
Is there any plan to support templates with managed code in the (near) future? For instance, VS.NET 2005... : )
8
by: JAL | last post by:
Here is my first attempt at a deterministic collection using Generics, apologies for C#. I will try to convert to C++/cli. using System; using System.Collections.Generic; using System.Text; ...
9
by: plahey | last post by:
I have been dabbling in Python for a while now. One of the things that really appeals to me is that I can seem to be able to use C++-style RAII idioms to deal with resource management issues. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.