Value Type Redux

  I’d like to thank Yves Dolce for responding to Wesner Moise who writes:   Sender: Wesner Moise   re: Value Type Representation Between the Original and Revised C++   I am not sure that I understand you when you say v.ToString() results in an error, because v needs to be boxed in order to…

2

Value Type Representation Between the Original and Revised C++

For the work I’ve been engaged in currently in machine translation of the original language design [thing1] to the revised design of the language [thing2], I have been variously making stabs at understanding the possible usages of a managed Value type [V] and pointer modifications of that type [V*, __box V*]. Artur Laksberg and Mahesh…

11

Some Thoughts on Program Efficiency

Program efficiency at the programmer level is something of a complicated issue – in part because it is contextual. That is, it is hard to say something that holds true in all cases. [This is why having a good profiler is essential.] For example, the same implementation may be adequate, if embarrassing (should anyone actually…

10

C++/CLI revision of the Managed Extension Reference Array Syntax

The declaration of a managed array object in the original language design was a slightly non-intuitive extension of the standard array declaration in which a __gc keyword was placed between the name of the array object and its possibly comma-filled dimension, as in the following pair of examples,   using namespace System;   void PrintValues(…

4

Supporting Direct Handles to Boxed Value Types

A reader, Yves Dolce, writes: Related to your last blog entry: The Astonishing S”Literal” String Type   I was surprised that sometimes, boxing is conceptually implicit… That any Object method can be called directly without any explicit boxing.   And of course, explicit boxing is valid but seems less efficient as a real object ends up being…

3

Bringing Existing ISO C++ to C++/CLI and Why We Don’t Change L”hi”

indranil banerjee writes   re: Virtual Function Behavior Between ISO C++ and C++/CLI Revisited   Thanks for the explanation. Rereading your earlier post and examples, it is quite clear that runtime resolution of virtuals is the same in both CLR and ISO C++.   However, now that I’ve understood the difference in virtual function resolution…

0

The Astonishing S”Literal” String Type

One of the astonishing infelicities of the original language design was the unflagged overhead of the seemingly trivial failing of placing an S in front of a string literal targeted to a managed reference object. For example, given the following two System::String declarations,                 String *ps1 = “hello”;       String *ps2 = S”goodbye”;  …

2

Virtual Function Behavior Between ISO C++ and C++/CLI Revisited

  I seem to have rather badly explained the `virtual function invocation within a constructor issue,’ if one is to judge by the following question posted as a follow-up to my blog entry, for which I apologize:     Sender: Indranil Banejree =====================================   re: Making a Virtual Table Context-Sensitive   Do you mean that…

1

The Name Return Value Optimization

I received the following mail the other day in response to my writing that the Visual C++ compiler has [finally!] implemented the name return value optimization (NRVO) in the Visual Studio 2003 release:   Sender: James Slaughter   I was in the process of catching up with your blog entries … when I spotted your…

6