Visual Studio 2010: Extensions / Discrepancies

Visual Studio 2010 has a number of extensions (activated by default) / inconsistencies regarding the C ++ standard.

Such discrepancies may be unexpected and cause different behavior than other behavior. VS is famous for being very weak in checking template code, and template code that has been accepted and compiled by VS will often be rejected directly by more compatible compilers (CLang, Comeau, icc, gcc, ... to name a few).

The purpose of this question is to provide a link (e.g. an FAQ tag) for these discrepancies.

Please indicate one response to the discrepancy (check the duplicate) and for each:

  • Explain the mismatch
  • Let us know if this can be disabled (and if so, how)
  • Explain the consequences (other than a simple refusal)

Note: C ++ 0x is the next standard, so avoid listing C ++ 0x extensions, as they will become standard soon

From @Matteo Italia: Visual Studio Compliance Page

+3
source share
5 answers

First of all, I would associate Microsoft with this question.

All Microsoft language extensions can be found here ; there is also a page listing areas of the language where VC ++ does not comply with the standard.

+6
source

By default, the compiler allows you to bind a temporary link to a non-constant link.

Remedy: Use Warning Level 4

+4
source

Visual ++ (, Visual ++, Visual ++ 2005 Visual ++ 2010 SP1).

(. ).

: , , .

: .

+1

: Visual Studio .

:

  • : , ( )
  • :

? , .

:

Visual Studio , :

  • , , ( unit test).
  • template typename VS
  • , , `template . , .
0

All Articles