I Love that New Syntax Smell

C++ articles, code snippets, musings, etc. from Andy RichIf this is your first time here, you may want to check out my blog introduction.

Browse by Tags

Tagged Content List
  • Blog Post: Properties Part 2 - defining default properties

    Disclaimer. This is an ancient post. By the looks of it, I originally intended to write this almost a year ago, as a follow up to my scalar properties writeup . That was back when I was testing properties (and more exactly, default properties) and some of the design was still in flux. Now it's pretty...
  • Blog Post: Another good customer bug

    Reader Andy Neilson writes in with another bug: The current compiler implementation has some problems. If the variable is a field of this, then the compiler will die. For example: class MyClass { public: int i; void Foo() { array<int>^ x = {1, 2, 3}; for each (i in x) { if (i == 2) break; } } ...
  • Blog Post: I love when customers find bugs!

    Reader Rob Walker asks: Is there a neat way of handling dictionaries? I have a Dictionary<Guid, Object^> and want to iterate over the values. Currently I have to use the syntax: for each(KeyValuePair<Guid, Object^> v in dict) { v.Value ... } I can't find an invocation that would allow for...
  • Blog Post: .NET, 7.0, 2003, what's it all mean?

    A reader asked the question: Is .NET, in fact, the SAME THING as Visual Studio 7.0? Could it be possible that a developer with .NET would be able to simply open the project file and recompile without rewriting code? .NET itself is a runtime. Unfortunately, the word ".NET" has started creeping...
  • Blog Post: Pointer to String chars - Everett style

    Garrett asked: If the source text is in a CLR String, and we want to pass(even read-only) to unmanaged code, it appears that there is no way to get a pointer to the String's buffer directly. We have to use the marshalling stuff to get it there, which in itself makes a copy. Given that one of...
  • Blog Post: The native heap/managed heap barrier

    Garrett asks: You mentioned: class A{}; array ^ arr = gcnew array (10);. Are you saying that whidbey will support this? What is it doing to the native pointer? Boxing? Managed array of native pointers to native objects? This didn't work in Everett, but it will in Whidbey. It probably wasn't...
  • Blog Post: Clarifications on the array template, and some about the CLR namespaces

    Garrett returns with some observations: Damn Cool. My only reservation is that it doens't *resemble* a native array, but that's ok too :) In some ways that is far better than the alternative. I was never quite thrilled about the cryptic nature of managed arrays before. Yeah, us either. That...
  • Blog Post: Why you ought not pre-jit, and why it sometimes makes sense.

    So, Raj asks: Thanks for the explanation but what is the deal with the IL and JIT. Why not just prejit the code? Why not pre-jit the code? Class, you didn't do the required reading . :) Actually, there are a couple of optimization reasons why you don't pre-jit code. Most of it deals with this...
  • Blog Post: Dave strikes again, a basic description of how .NET works.

    Dave asks: i have tried some UI examples in the book, but it was quite slow. when I execute the program, it takes 1.5-2seconds to see the window on the screen, on the other hand plain win32 api creates window before 1st second. doesn't .net generate native win32 binary code? what does it load/do...
  • Blog Post: VC++ .NET Examples, a tiny Visual Studio timeline, how to participate in the Whidbey Beta

    Reader Dave commented: back to lack of visual c++ .net examples. I saw that there are lots of c# examples, this is good because C# is a new language and if i am correct, it is built for .net. there are vb.net examples, too, but there is not a visual c++ .net example displaying a window on the screen...
  • Blog Post: A little Q&A

    Reader Dave asks: I am using Visual Studio 7.0 (2002?). I turn on my computer in the morning, and run it until midnight and my visual studio is always open. however, it consumes 60-150MB Virtual memory, specifically when i use VisualPerl (I usually use Visual C++). sometimes i need to run two instances...
  • Blog Post: Mono, more on cross-platform

    Mono (very different from mono ), is, at its core, an implementation of the Common Language Specification - which we purposefully made public domain through ECMA . Mono is pretty cool, too, and I'm personally glad to see it. They even praise the standard Microsoft helped develop: The Common Language...
  • Blog Post: C++ feature "lag," native types on the GC Heap, a plug for some software I like

    Garrett points out: I *am* a tad sad that C++ tends to lag a generation behind C# on features in .NET. I realize that's likely due to the larger effort required, with less resources than C#, and it seems that C++ is less ...sexy... than C#, but it's still sad . :( Yes, it is true that C# is...
  • Blog Post: Will .NET be available for non-Windows platforms?

    I thought this deserved a post, and not be buried in a comment.  Dave asks: Wow! it seems you are empowering c++ for CLR. will .net be available for non-windows platforms? IT ALREADY IS!   Being Microsoft, you'd think .NET would be a Windows-only innovation.  But, happily, it isn't.  My buddy...
  • Blog Post: More questions, more clarifications.

    Garrett asked some further questions that were also good.  Good enough, in fact, that I didn't know the answers.  So I went down the hall and asked Brandon .  I'll paraphrase what Brandon told me here. 1. What about partial types? What are partial types?   For those of you unaware about partial...
  • Blog Post: Whidbey and Managed Extensions, clarifications.

    Garrett Serack made some comments on my last blog entry that I thought were interesting enough to share with everyone.  He asks: And how about forward source-level compatability between .net 1.1 and whidbey? Is the current batch of Managed C++ gonna work just as well? Yes!   One of our goals...
Page 1 of 1 (16 items)