Van's House

I'm a developer at C++ team. I'm interested in everything related to C++

Make your code faster to compile

I'm recently investigating a VS feedback on compilation time. There are some interesting findings...

Author: Xiang Fan Date: 03/07/2017

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...

Author: Xiang Fan Date: 02/24/2016

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...

Author: Xiang Fan Date: 02/24/2016

Debug vs Release - v2

Four and half a year ago (how time flies), I wrote a post about the potential issues mixing debug...

Author: Xiang Fan Date: 03/25/2013

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...

Author: Xiang Fan Date: 12/28/2012

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...

Author: Xiang Fan Date: 11/03/2012

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...

Author: Xiang Fan Date: 02/06/2012

C++: Under the Hood

This is an article written by Jan Gray. It is quite old, but most of the contents still apply today....

Author: Xiang Fan Date: 02/06/2012

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...

Author: Xiang Fan Date: 02/03/2012

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...

Author: Xiang Fan Date: 01/15/2012

Speed up iostream

Throughput of iostream is considered much slower compared with its C counterpart. For example:...

Author: Xiang Fan Date: 01/12/2012

Protected or Private II

Someone reminds me that it has been nearly 2 years since my last blog post. How time flies! Many...

Author: Xiang Fan Date: 01/07/2012

C++0x features in VC2010 - nullptr

Summary Page (n3090.pdf is the current working draft of C++0x standard, it is available at...

Author: Xiang Fan Date: 05/10/2010

C++0x features in VC2010 - some decltype bugs

  1. decltype(*&function) https://connect.microsoft.com/VisualStudio/feedback/details/510640 int...

Author: Xiang Fan Date: 05/09/2010

C++0x features in VC2010 - decltype

Summary Page (n3090.pdf is the current working draft of C++0x standard, it is available at...

Author: Xiang Fan Date: 05/09/2010

C++0x features in VC2010 - auto

Summary Page (n3090.pdf is the current working draft of C++0x standard, it is available at...

Author: Xiang Fan Date: 05/09/2010

C++0x features in VC2010 - static_assert

Summary Page (n3090.pdf is the current working draft of C++0x standard, it is available at...

Author: Xiang Fan Date: 05/09/2010

C++0x features in VC2010 - Summary

VC2010 has been released for a while. It adds many C++0x features (The complete list can be found...

Author: Xiang Fan Date: 05/09/2010

VC's "evil" extension: Pre-definition of basic types

In VC, you may find that you can use "size_t" directly without including any headers.size_t i =...

Author: Xiang Fan Date: 03/03/2010

VC's "evil" extension: Implicit definition of static constant member

C++ supports in-class initialization of static integral constant members. It is nearly the same as...

Author: Xiang Fan Date: 03/03/2010

VC's "evil" extension: $

In C++, only a few characters can be used as part of the identifier. identifier: identifier-nondigit...

Author: Xiang Fan Date: 03/03/2010

Inline or Not Inline

What is inline? This keyword is mainly used to ask the compiler to inline substitution of the...

Author: Xiang Fan Date: 11/25/2009

Visual C++ Shanghai Team Blog is Online

I’m glad that our team blog is now online (http://blogs.msdn.com/vcshblog/). It is in Chinese and is...

Author: Xiang Fan Date: 09/11/2009

Output Text in Unicode

According to C standard, it only supports output text in MBCS (Multi-Byte Character String):...

Author: Xiang Fan Date: 08/04/2009

IDA Pro 5.5 is released

IDA Pro 5.5 ships 12th of June 2009. The change list is here:...

Author: Xiang Fan Date: 06/17/2009

Detect Shift Overflow

This is an intellectual exercise: when shifts a 32-bit unsigned integer in C++, how to detect...

Author: Xiang Fan Date: 06/13/2009

Recursive Algorithm in C++

Many recursive algorithms have initial parameters. For example, Fibonacci Number is defined as: Fn =...

Author: Xiang Fan Date: 05/23/2009

Measure Initialization Time of Global Variables

NOTICE: The technique describes in the article may not be supported in future release of VC. You...

Author: Xiang Fan Date: 05/12/2009

Optimize Your Code: Matrix Multiplication

Matrix multiplication is common and the algorithm is easy to implementation. Here is one example:...

Author: Xiang Fan Date: 04/28/2009

C++ Template Trick: Detecting Object Slicing

Object slicing often happens when you pass the object by value. Compiler will do implicitly...

Author: Xiang Fan Date: 03/22/2009

C++ Template Trick: Detecting the Existence of Class Member at Compile Time

C++0x will provide a full set of type traits helpers to ease generic programming. However, there is...

Author: Xiang Fan Date: 02/09/2009

Standard library changes in C++0x

C++0x will be released in the near future. Do you know the changes of standard library? Here is a...

Author: Xiang Fan Date: 01/12/2009

Enable syntax highlighting for TR1 headers in VS2008 SP1

Unfortunately, VS2008 SP1 doesn't recognize C++ tr1 headers. That means there are no syntax...

Author: Xiang Fan Date: 12/12/2008

VC extensions list

MSDN has a page describing various VC extensions. But it is far from complete. I've collected a list...

Author: Xiang Fan Date: 12/11/2008

Contiguousness of STL containers and string

In C++, it is well-known that the data in the vector is contiguous. To be more specific, here is the...

Author: Xiang Fan Date: 12/04/2008

Protected or Private?

As the designer of base class, you may hesitate whether to use private or protect access control....

Author: Xiang Fan Date: 10/15/2008

IDA Pro 5.3 Demo is released

IDA Pro is the world-class disassembler. It's a very useful reverse engineering tool. Now the demo...

Author: Xiang Fan Date: 10/05/2008

Minimize the size of your program - low level

NOTICE: The following is not intended for real-world application. It is just an intellectual...

Author: Xiang Fan Date: 09/27/2008

Minimize the size of your program - assembly source

; based on tiny.asm, modified by xiangfan ;e_cblp 2b;tbl 1b;hexstr 1b;LoaderFlags 4b BITS 32 ;; MZ...

Author: Xiang Fan Date: 09/27/2008

Minimize the size of your program - high level

NOTICE: The following is not intended for real-world application. It is just an intellectual...

Author: Xiang Fan Date: 09/19/2008

Obfuscate your code

Obfuscation is widely used to protect your code from reverse engineering.Here is one example which...

Author: Xiang Fan Date: 09/16/2008

Magic behind ValueType.Equals

In "Effective C#", Bill Wagner says "Always create an override of ValueType.Equals() whenever you...

Author: Xiang Fan Date: 09/01/2008

Debug vs Release

Someone may wonder what the difference is between Debug and Release mode, and whether it is possible...

Author: Xiang Fan Date: 08/30/2008

Conformance macros in VC STL

In VC STL, there are two macros called "_HAS_IMMUTABLE_SETS" and "_HAS_STRICT_CONFORMANCE" which are...

Author: Xiang Fan Date: 08/30/2008

Online C++ Compilation Service

There are many useful online c++ compilation service providers. You can use them to do conformance...

Author: Xiang Fan Date: 08/29/2008