The String Literal Returns

In the last entry, I celebrated what I felt was an elegant solution to the problem of the string literal in the context of overload function resolution. But it turns out there is another area in which the string literal proves problematic. Who would have thought such a foobar kind of entity could cause so…

26

The Type of a String Literal Revisited …

In the course of these entries, I have twice addressed the issue of the type of a string literal under C++/CLI — in particular when resolving an overloaded function call. The issue is illustrated in the following example, public ref class R { public:   void foo( System::String^ ); // (1)   void foo( std::string…

4

A Primer on the Interior Pointer

A value type is typically not subject to garbage collection except in two cases: (a) when it is the subject of a box operation, either explicit or implicit, such as, void f( int ix ) {     // explicit placement on the CLI heap     int^ result = gcnew int( -1 );       //…

9

Translation Guide between Managed Extensions and the new C++/CLI binding Available

C and C++ programmers are notorious for relying on pointer indirection, and it seems blog entries are not immune to this. A translation guide attempting to exhaustively detail the differences between the original Managed Extensions for C++ (released with Visual Studio.NET) and the revised C++ binding to the CLI scheduled for Visual Studio 2005 (and…

10

An Tour of the STL.NET

Part of the (reasonably pleasant) distractions from posting on this blog recently has been working up the first in a series of articles on STL.NET for our Visual C++ MSDN web site. The amount of work to get from an articulation of a topic to a formal publication of it is an amazingly labor-intensive 10%…

12

Why C++ Supports both Class and Typename for Type Parameters

Recently, someone asked me why we support both class and typename within C++ to indicate a type parameter since the keywords do not hold any platform significance – for example, class is not meant to suggest a native type nor is typename meant to suggest a CLI type. Rather, both equivalently indicate that the name…

6

Why C++/CLI Supports both Templates for CLI Types and the CLI Generic Mechanism

I’ve been recently puzzling out a strategy for presenting the two mechanisms supporting parameterized types available to the C++/CLI  programmer: she can use either the template mechanism adapted for use with CLI types, or the CLI generic mechanism. This is not unique to the support of parameterized types, of course, but it seems a lightening…

16

Identifying the Candidate Function Set

Sorry it is taking me so long these days. I am in the throes of more formal writing – a book on our CLI binding for C++, and a series of articles for our Visual C++ MSDN website on STL.NET. And my translation tool is happily going through a formal test cycle – thank you…

6

The Value of a Value Class

A reader questions the nature of the value type when he writes,   Sender: Slawomir Lisznianski=====================================1) Lack of support for SMFs makes value classes unnatural to use. An example in the C++/CLI spec at page 33 is incorrect, as it uses constructors with value classes. In fact, quite a few value class examples in the…

9

String Literal Conversion to String: Is It a Disaster?

A reader asks,   Sender: Jackre: String Literals are now a Trivial Conversion to StringWon’t it break most of existing libraries who will try to port to C++/CLI? One override for String^ will break a lot of user code and make calls for the overriden function with string literals look much uglier. Maybe it is…

1