Van's House

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

  • Van's House

    Optimize Your Code: Matrix Multiplication

    • 3 Comments
    Matrix multiplication is common and the algorithm is easy to implementation. Here is one example: Version 1: template < typename T> void SeqMatrixMult1( int size, T** m1, T** m2, T** result) { for ( int i = 0; i < size; i++) { for ( int j...
  • Van's House

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

    • 1 Comments
    C++0x will provide a full set of type traits helpers to ease generic programming. However, there is no support for the detection of class members. The general problem is hard. Here we will try to tackle the more specific version: detecting the class member...
  • 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

    Debug vs Release

    • 1 Comments
    Someone may wonder what the difference is between Debug and Release mode, and whether it is possible to mix them. Here is one example: http://forums.msdn.microsoft.com/en-US/vcgeneral/thread/775ce067-b225-4141-8b86-2d7e9b61db97/ syperk said: "As...
  • 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 - 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

    Contiguousness of STL containers and string

    • 1 Comments
    In C++, it is well-known that the data in the vector is contiguous. To be more specific, here is the quotation from the standard (C++03, 23.2.4/1) The elements of a vector are stored contiguously, meaning that if v is a vector<T, Allocator> where...
  • 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

    Standard library changes in C++0x

    • 3 Comments
    C++0x will be released in the near future. Do you know the changes of standard library? Here is a list of changes that I've collected (minor behavior changes and changes related to concepts are not included). 1. New stuff system_error: new header array...
  • Van's House

    Magic behind ValueType.Equals

    • 1 Comments
    In "Effective C#", Bill Wagner says "Always create an override of ValueType.Equals() whenever you create a value type". His main consideration is the performance, because reflection is needed to compare two value types memberwisely. In fact, the framework...
  • 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

    VC extensions list

    • 2 Comments
    MSDN has a page describing various VC extensions. But it is far from complete. I've collected a list of nonstandard extensions provided by VC, some of them are evil . If you want to write standard conformant C++ code, you'd better be aware of these...
  • Van's House

    Minimize the size of your program - high level

    • 1 Comments
    NOTICE: The following is not intended for real-world application. It is just an intellectual exercise to minimize the size of the program. The generated PE file may or may not be valid as it depends on behavior of specific architecture, OS and toolset...
  • 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

    Enable syntax highlighting for TR1 headers in VS2008 SP1

    • 3 Comments
    Unfortunately, VS2008 SP1 doesn't recognize C++ tr1 headers. That means there are no syntax highlighting and no intellisense for these files. This is a bug, but you can fix it by yourself. The trick is in the registry. VS maintains a list of extensionless...
  • Van's House

    Minimize the size of your program - low level

    • 1 Comments
    NOTICE: The following is not intended for real-world application. It is just an intellectual exercise to minimize the size of the program. The generated PE file may or may not be valid as it depends on behavior of specific architecture, OS and toolset...
  • Van's House

    Conformance macros in VC STL

    • 1 Comments
    In VC STL, there are two macros called "_HAS_IMMUTABLE_SETS" and "_HAS_STRICT_CONFORMANCE" which are defined in yvals.h. They are related to some defects in the C++ standard 2003. 1. _HAS_IMMUTABLE_SETS will influence the constness of set::iterator...
  • 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

    IDA Pro 5.3 Demo is released

    • 1 Comments
    IDA Pro is the world-class disassembler. It's a very useful reverse engineering tool. Now the demo of the newest version 5.3 is available: IDA Pro 5.3 demo download You can also try the freeware version (a little out of date): IDA Pro 4.9 Freeware
  • 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

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

    Online C++ Compilation Service

    • 2 Comments
    There are many useful online c++ compilation service providers. You can use them to do conformance test and portability test without purchasing and installing various kinds of compilers. The following sites are the most famous: http://www.dinkumware...
  • 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

    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...
Page 1 of 2 (43 items) 12