Van's House

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

  • Van's House

    Debug vs Release - v2

    • 1 Comments
    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...
  • Van's House

    Connect Bugs that I Fixed

    • 2 Comments
    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...
  • Van's House

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

    • 0 Comments
    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...
  • Van's House

    System.Uri doesn’t allow trailing dot

    • 0 Comments
    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...
  • Van's House

    C++: Under the Hood

    • 0 Comments
    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...
  • Van's House

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

    • 2 Comments
    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...
  • Van's House

    System.Uri doesn’t allow embedded escaped slashes

    • 6 Comments
    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...
  • Van's House

    Speed up iostream

    • 1 Comments
    Throughput of iostream is considered much slower compared with its C counterpart. For example: printf( "1234567\n" ); cout << "1234567" << endl; If you iterate 10 5 times, printf takes about 50ms while cout takes >1s. This looks...
  • Van's House

    Protected or Private II

    • 0 Comments
    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. ...
  • Van's House

    C++0x features in VC2010 - nullptr

    • 0 Comments
    Summary Page ( n3090.pdf is the current working draft of C++0x standard, it is available at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3090.pdf ) What we have before C++0x Everyone knows that null pointer value is NULL. In C...
  • Van's House

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

    • 0 Comments
    1. decltype(*&function) https://connect.microsoft.com/VisualStudio/feedback/details/510640 int foo(); decltype (*&foo) df; // it should be "int (&)()", but it is "int (*)()" The internal representation (it is special for...
  • Van's House

    C++0x features in VC2010 - decltype

    • 0 Comments
    Summary Page ( n3090.pdf is the current working draft of C++0x standard, it is available at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3090.pdf ) What we have before C++0x When do generic programming in C++, you often have to...
  • Van's House

    C++0x features in VC2010 - auto

    • 1 Comments
    Summary Page ( n3090.pdf is the current working draft of C++0x standard, it is available at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3090.pdf ) What we have before C++0x C++ is a strongly typed programming language. You have...
  • Van's House

    C++0x features in VC2010 - static_assert

    • 0 Comments
    Summary Page ( n3090.pdf is the current working draft of C++0x standard, it is available at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3090.pdf ) What we have before C++0x It is a common task to output meaningful error message...
  • Van's House

    C++0x features in VC2010 - Summary

    • 0 Comments
    VC2010 has been released for a while. It adds many C++0x features (The complete list can be found here: C++0x Core Language Features In VC10: The Table ) In the following posts, I’d like to share some of my experience of these new features. They...
  • Van's House

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

    • 0 Comments
    In VC, you may find that you can use "size_t" directly without including any headers. size_t i = 0; int main() { atexit(0); } However, "size_t" is not a built-in type. It is a typedef in <stddef.h>. So what's the magic? In VC compiler, it...
  • Van's House

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

    • 0 Comments
    C++ supports in-class initialization of static integral constant members. It is nearly the same as enum, with the following difference (quoted from C++03 9.4.2.4 ([class.static.data])): The member shall still be defined in a namespace scope if it is...
  • Van's House

    VC's "evil" extension: $

    • 2 Comments
    In C++, only a few characters can be used as part of the identifier. identifier: identifier-nondigit identifier identifier-nondigit identifier digit identifier-nondigit: nondigit universal-character-name other implementation-defined characters nondigit...
  • Van's House

    Inline or Not Inline

    • 0 Comments
    What is inline? This keyword is mainly used to ask the compiler to inline substitution of the function body at the point of call. Like 'register', this is only a suggestion to the compiler. Modern compiler can handle inlining using advanced heuristic...
  • Van's House

    Visual C++ Shanghai Team Blog is Online

    • 0 Comments
    I’m glad that our team blog is now online ( http://blogs.msdn.com/vcshblog/ ). It is in Chinese and is targeted to Chinese developers. We will write technical articles related to our work in Shanghai and also translate articles on VCBlog into Chinese...
  • Van's House

    Output Text in Unicode

    • 0 Comments
    According to C standard, it only supports output text in MBCS (Multi-Byte Character String): n1124.pdf , 7.19.3/12 The wide character output functions convert wide characters to multibyte characters and write them to the stream as if they were written...
  • Van's House

    IDA Pro 5.5 is released

    • 1 Comments
    IDA Pro 5.5 ships 12th of June 2009. The change list is here: http://www.hex-rays.com/idapro/55/index.htm
  • Van's House

    Detect Shift Overflow

    • 0 Comments
    This is an intellectual exercise: when shifts a 32-bit unsigned integer in C++, how to detect whether the calculation overflows efficiently? Here is the function prototype. shl_overflow will return true if v << cl overflows (cl is between 0 and...
  • Van's House

    Recursive Algorithm in C++

    • 1 Comments
    Many recursive algorithms have initial parameters. For example, Fibonacci Number is defined as: Fn = Fn-1 + Fn-2, with F1 = F2 = 1. By giving different values to F1 and F2, we can generate different sequence of numbers. 1. If we implement the algorithm...
  • Van's House

    Measure Initialization Time of Global Variables

    • 1 Comments
    NOTICE: The technique describes in the article may not be supported in future release of VC. You should not use it in production code There are two kinds of initialization in C++: static initialization and dynamic initialization. According to the...
Page 1 of 2 (43 items) 12