Connect Bugs that I Fixed

Similar to STL’s post on vcblog, I generate a table of connect bugs that I have fixed after I officially worked on the compiler front end: Connect ID Title 581680 Lambda declaration cannot access closure variables when defined as a  member function of an inline class 584664 Visual C++ compiler crashes while trying to compile some templates…


November CTP of Visual C++ compiler, more C++11 features

Our team announced Novemeber CTP of Visual C++ compiler. It contains the following C++11 features besides those already in VS2012: Variadic templates Uniform initialization and initializer_lists Delegating constructors Raw string literals Explicit conversion operators Default template arguments for function templates


System.Uri doesn’t allow trailing dot

Again, System.Uri tries to be smart and does something on my behalf 🙁 This time, the victim is trailing dot (which is common in wiki pages). See this connect bug for details. The workaround is similar to the one described in this post. The only difference is that we need ‘GenericUriParserOptions.DontCompressPath’ instead.


C++: Under the Hood

This is an article written by Jan Gray. It is quite old, but most of the contents still apply today. The original article on MSDN can no longer be found. Here is the pdf version on OpenRCE: Overview: How are classes laid out? How are data members accessed? How are member functions called? What…


C++98 -> C++11: Pass by value or pass by reference?

In GoingNative 2012, there are some discussions on the new coding style for C++11. One interesting thing which is mentioned by Bjarne Stroustrup, Stephan T. Lavavej and Herb Sutter is the most efficient way to pass the argument. In C++98, pass by reference is in general more efficient because it saves extra copies (if the…


System.Uri doesn’t allow embedded escaped slashes

I use C# a lot to write small utilities and sometimes find that it is annoying to have to dig into the source code to figure out why .Net framework doesn’t work as I expected. This happens again when I am using LinkedIn API (BTW, this is the first occurence of such experience). LinkedIn API…


Speed up iostream

Throughput of iostream is considered much slower compared with its C counterpart. For example: printf(“1234567\n”); cout << “1234567” << endl; If you iterate 105 times, printf takes about 50ms while cout takes >1s. This looks quite annoying. After digging into the source of iostream (not an easy task 🙂 ), I finally figure out that…


Protected or Private II

Someone reminds me that it has been nearly 2 years since my last blog post. How time flies! Many things happened during this period. I moved to Redmond and I’m now officially working on C++ compiler. The work is busy and also challenging. Recently, there was a thread in our internal discussion list which mentioned…