I'm a developer at C++ Shanghai team. I'm interested in everything related to C++
Browse by Tags
-
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 Read More...
|
-
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. Read More...
|
-
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 Read More...
|
-
IDA Pro 5.5 ships 12th of June 2009. The change list is here: http://www.hex-rays.com/idapro/55/index.htm Read More...
|
-
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 Read More...
|
-
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 Read More...
|
-
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 standard, Read More...
|
-
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 = 0; Read More...
|
-
Object slicing often happens when you pass the object by value. Compiler will do implicitly conversion from derived to base for you without any warning message. If you want to detect object slicing, you're on your own. However, template can help you. Read More...
|
-
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 Read More...
|
-
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, Read More...
|
-
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 Read More...
|
-
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 extensions Read More...
|
-
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 Read More...
|
-
As the designer of base class, you may hesitate whether to use private or protect access control. Then, let's try the following examples: 1. Call protected member function #include <cstdio> class A { protected : void b() {printf( "Oops!\n" );} }; Read More...
|