Make your code faster to compile

I’m recently investigating a VS feedback on compilation time. There are some interesting findings during the investigation and I’d like to share them in this blog post. Here is the repro to demonstrate the issue. In the code, we define 512 classes. We also provide a global operator<< for each class. The problem here is…

0

Connect Bugs that I Fixed - Part II

I generate a new table of connect bugs that I have fixed after I published my last post: 749130 Compiler allows formation of cv-qualified reference-to-function type 754684 premature decay of function types in overloaded assignment operator 760058 Conditional (ternary) operator with throw expression produces lvalue rather than rvalue 761742 Failed to call destructor of a…

1

System.Uri in .Net 4.5 and un-escaping "%27"

I lost access to my MSDN blog account for some reason and regained it recently. I also spent some time figuring out how to get Windows Live Writer installed on Win10 which is much harder than I first thought (an easier way is described here). This post is a follow up to the previous two…

1

Debug vs Release - v2

Four and half a year ago (how time flies), I wrote a post about the potential issues mixing debug and release CRT in the same program. At the end, it says, ‘It’s fortunate that this is a linker error. Otherwise, you’ll waste lots of time in debugging to find out the subtle incompatibility’. Today, in…

2

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…

2

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

0

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.

0

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: http://www.openrce.org/articles/files/jangrayhood.pdf. Overview: How are classes laid out? How are data members accessed? How are member functions called? What…

0

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…

2

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…

7