Visual Studio 2010 features a number of extensions (activated by default) / discrepancies with regard to the C++ Standard.
Such discrepancies can be surprising, and elicit a different behavior than other behavior. VS is notably famous for being extremely lax in template code validation, and template code that was accepted and compiled by VS will often be rejected outright by more compliant compilers (CLang, Comeau, icc, gcc, ... to name a few).
The goal of this question is to provide a reference (thus the FAQ tag) for these discrepancies.
Please provide one answer per discrepancy (check for duplicate) and for each:
- Explain the discrepancy
- Tell us if it is possible to disable this (and if so, how)
- Explain the consequences (apart from the mere rejection)
Note: C++0x is the next standard, so avoid listing C++0x extensions, since they'll be standard soon
From @Matteo Italia: Visual Studio Compliance Page