Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/MicrosoftDocs/cpp-docs/llms.txt

Use this file to discover all available pages before exploring further.

The Microsoft C++ compiler (MSVC) implements the C++ programming language as defined by the ISO/IEC C++ International Standard, along with a set of Microsoft-specific extensions for Windows platform development. This reference documents the language as implemented in Visual Studio, drawing on the organization established by The Annotated C++ Reference Manual by Margaret Ellis and Bjarne Stroustrup. Whether you are coming to C++ for the first time or returning after years with other languages, this reference covers every major feature area — from fundamental types and expressions all the way through templates, exceptions, and the modern C++ idioms introduced since C++11.
You can target a specific C++ standard version using the /std compiler option in Visual Studio. MSVC supports /std:c++14, /std:c++17, /std:c++20, and /std:c++latest (for C++23 preview features).

What MSVC Supports

MSVC provides broad conformance to the ISO C++ standard across all modern revisions:
StandardKey Features Added
C++11auto, nullptr, lambdas, move semantics, constexpr, range-based for, smart pointers, static_assert
C++14Generic lambdas, variable templates, relaxed constexpr, std::make_unique
C++17Structured bindings, if constexpr, std::optional, std::variant, std::string_view, parallel algorithms
C++20Concepts, ranges, coroutines, modules, std::span, three-way comparison (<=>)
C++23std::expected, std::flat_map, import std;, std::print
For an overview of modern C++ best practices—smart pointers, move semantics, lambdas, and more—see the Modern C++ page in this section.

Language Areas Covered

Basic Concepts

Scope, linkage, translation units, the One Definition Rule, lvalues and rvalues, alignment, and trivial/POD types — the foundational rules that govern every C++ program.

Types and Declarations

Fundamental built-in types, const and volatile qualifiers, typedef and using aliases, auto type deduction, decltype, and type conversion rules.

Classes and Structs

Class and struct definitions, member functions, constructors, destructors, inheritance, virtual functions, access control, friend declarations, and the Rule of Five.

Templates

Function and class templates, type parameters, non-type parameters, full and partial specialization, variadic templates, and C++20 concepts.

Exception Handling

C++ try/catch/throw, the standard exception hierarchy, noexcept, exception specifications, and Windows Structured Exception Handling (SEH).

Modern C++

Smart pointers, move semantics, perfect forwarding, lambdas, range-based for, constexpr, std::optional, std::variant, std::span, and C++20 concepts.

Additional Language Features

Beyond the core topics in this section, the MSVC C++ Language Reference also covers:
  • Lexical Conventions — tokens, comments, keywords, punctuators, literals, and file translation phases
  • Operators — all built-in operators with their precedence and associativity rules
  • Expressions — expression types, value categories, casting operators, and runtime type information (RTTI)
  • Statements — selection, iteration, jump, and declaration statements
  • Unions — user-defined types where all members share the same memory location
  • Overloading — function and operator overloading rules
  • Microsoft-Specific Modifiers__declspec, calling conventions, __asm, and other MSVC extensions
  • Compiler COM Support — Microsoft-specific classes and functions for COM interop

MSVC-Specific Extensions

The Microsoft C++ compiler includes extensions that are not part of the ISO standard but are useful for Windows development:
// __declspec for controlling storage class and other attributes
__declspec(dllexport) void MyFunction();
__declspec(noinline)  void NoInline();
__declspec(align(16)) struct AlignedStruct { float data[4]; };

// Microsoft calling conventions
void __cdecl    CdeclFunc(int x);
void __stdcall  StdcallFunc(int x);
void __fastcall FastcallFunc(int x);
Microsoft-specific extensions may reduce portability to non-Windows or non-MSVC compilers. Prefer ISO standard features where possible. Use __declspec and similar modifiers only when targeting Windows-specific functionality.

See Also

Build docs developers (and LLMs) love