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

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

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

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

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

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

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

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

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

Playing with the compiler is interesting. One challenge for the compiler writer is compilation performance. There're many kinds of C++ code which are the nightmare for the compiler. Now let's go!
1. Preprocess
a. Self Inclusion (GCC only) Normally...

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

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

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

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