Enable syntax highlighting for TR1 headers in VS2008 SP1

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 files, and will treat them as cpp files. It is under:…

3

VC extensions list

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 which are on by default. Some commonly (mis-)used extensions are in bold. W4001: nonstandard extension ‘single line…

2

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 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 T is some type other than bool, then it obeys the identity…

1