Talk:C++/CLI

message: To Habbit:
Examples in C# and C++/CLI are not equivalent.
Reason: MyClass auto in C++ example "lives" to the end of function. If you want same behaviour in C# example, you should use using block over the entire function. That is the reason I modified using block in past. I found nothing strange about that modification. Can you explain to me what is so strange about that? Jakiša Tomić 19:33, 5 April 2006 (UTC)
thread_title:  Using block 

message: As above, how about the introduction to generics, type safty, and a bunch more? I will be glad to put this up, just I don't have the time right now. Maybe next week.Eagle  talk 06:24, 7 May 2006 (UTC)
replies: text: Yes, though some of it is C++/CLI specific.Eagle talk 02:49, 7 June 2006 (UTC)
thread_title:  you do know that this does not even scratch the surface.... 

message: The article barely (or not at all) explains WHAT is CLI, how it is different from C++, the relation to .NET, etc. Most of it is a list of technical specs, which is not very useful to most people. 88.155.88.39 23:17, 15 February 2007 (UTC)
thread_title:  Lacks generic explanation/overview 

message: It's really strange that the first code examples in this page are of the older managed C++ and not of C++\CLI.  Shouldn't the document simply lead in with C++\CLI, and have a History section later?
I'd like to know when C++/CLI was first introduced. That would be something useful to add to this article. Zobdos (talk) 13:02, 17 September 2008 (UTC)
replies: text: I completely agree that in that the continued inclusion of Managed C++ examples (especially being ahead of the CLI examples) are thoroughly confusing.  My vote is to move the MC++ examples elsewhere.  Todd (talk) 10:33, 18 November 2011 (UTC)
thread_title:  strange focus 

message: I find the sentence "Of course, operator overloading is static, as is and always should be, not only when writing managed code" a bit strange. It sounds very biased and taking things for granted even though there might not be an absolute truth to it. Does all programming languages that support operator overloading use static overloading? Can somebody give a reference as to why static operator overloading is always the best? TobiasPersson (talk) 19:32, 27 November 2007 (UTC)
replies: text: One reason operator overloading is static is that, in the case of operator== you could write "bool xEqualsY= x == y;" where x was null. In this case if == were not static, you'd be calling the operator implementation on null and would get a null reference exception.  —Preceding unsigned comment added by 83.244.199.2 (talk) 15:47, 20 May 2008 (UTC)
replies: text: Yes, I think I've seen this example before and it do makes sense. Nevertheless, the phrasing seems less neutral than I prefer and there are languages that do allows non-static operator overloading, so I would suggest that someone more capable with the subject reformulates the text in the section. TobiasPersson (talk) 13:54, 22 July 2008 (UTC)
replies: text: I understand the logic in the argument but I must disagree. Having an operator throw an exception for the above example is precisely what should happen. Consider what it means to use operator==(); you want to compare the *contents* of 2 locations in memory. If one of those locations is NULL, then the comparison cannot be made and is itself invalid. As for the comment, it should be reduced to a statement of fact only, i.e. "Operator overloading is static for managed code." 161.165.196.84 (talk) 21:40, 8 September 2009 (UTC)
thread_title:  Static operator overloading 

message: First there should be a standalone description explaining how it differs from standard C++.
Then at the end there can be a section on how it differs from MC++.  —Preceding unsigned comment added by Dave Yost (talk • contribs) 20:24, 17 March 2010 (UTC)
thread_title:  Article should start with standalone description 

message: I think the focus is a bit too much on syntax of the language. I would suggest to add a little phrase on when to use it over tradition C++ and .NET most common language C#. Something like: The language C++/CLI makes it easy to write code that needs to inter operate with unmanaged code. It is especially used for marshaling between managed and unmanaged types. Other languages need to use the P/Invoke marshaller which has limited capabilities compared to what C++/CLI can do. If this is not the goal of your project, C# for making .NET programs or C++ for making the native bound executables would be a better option.  —Preceding unsigned comment added by AntonHogervorst (talk • contribs) 14:29, 22 July 2010 (UTC)
thread_title:  Goal or Market of the language 

message: From the article: "Every * becomes a ^, every & becomes an %". Has a reliable source described a way to write C++ code that compiles both as standard C++ (for use on non-Microsoft platforms) and as verifiably type-safe C++/CLI (for use on .NET platforms with tight security policies)? --Damian Yerrick (talk | stalk) 05:53, 7 February 2011 (UTC)
replies: text: Dunno if a reliable sourece has described it but presumablly you could use #define to choose which structures to use at compile time. You would have to be very careful to write code that works correctly either way. Still I think it could be done if you made the code use "managed pointers" in C++/CLI and shared_ptr/weak_ptr in regular C++. 130.88.108.187 (talk) 15:08, 27 January 2012 (UTC)
thread_title:  Code that is both standard and type-safe