C++ 语言参考C++ Language Reference

本参考说明了在 Microsoft c + + 编译器中实现的 c + + 编程语言。This reference explains the C++ programming language as implemented in the Microsoft C++ compiler. 组织基于 带批注的 c + + 参考手册 By Margaret Ellis 和 Bjarne Stroustrup,以及 ANSI/ISO c + + 国际标准 (ISO/IEC FDIS 14882) 。The organization is based on The Annotated C++ Reference Manual by Margaret Ellis and Bjarne Stroustrup and on the ANSI/ISO C++ International Standard (ISO/IEC FDIS 14882). 本文涵盖了 C++ 语言功能的 Microsoft 专用实现。Microsoft-specific implementations of C++ language features are included.

有关现代 c + + 编程做法的概述,请参阅 欢迎回到 c + +For an overview of Modern C++ programming practices, see Welcome Back to C++.

请参阅下面的表以快速查找关键字或运算符:See the following tables to quickly find a keyword or operator:

本节内容In This Section

词法约定Lexical Conventions
C++ 程序的基本词法元素:标记、注释、运算符、关键字、标点符号、文本。Fundamental lexical elements of a C++ program: tokens, comments, operators, keywords, punctuators, literals. 此外,还有文件转换、运算符优先级别/关联性。Also, file translation, operator precedence/associativity.

基本概念Basic Concepts
范围、链接、程序启动和终止、存储类以及类型。Scope, linkage, program startup and termination, storage classes, and types.

内置类型 内置于 c + + 编译器中的基本类型及其值范围。Built-in types The fundamental types that are built into the C++ compiler and their value ranges.

标准转换Standard Conversions
内置类型之间的类型转换。Type conversions between built-in types. 此外,算术转换和指针、引用与成员指针类型之间的转换。Also, arithmetic conversions and conversions among pointer, reference, and pointer-to-member types.

声明和定义 声明和定义变量、类型和函数。Declarations and definitions Declaring and defining variables, types and functions.

运算符、优先级和结合性Operators, Precedence and Associativity
C++ 中的运算符。The operators in C++.

表达式Expressions
表达式的类型、表达式的语义、有关运算符的参考主题、强制转换和强制转换运算符、运行时类型信息。Types of expressions, semantics of expressions, reference topics on operators, casting and casting operators, run-time type information.

Lambda 表达式Lambda Expressions
隐式定义函数对象类和构造该类类型的函数对象的编程技术。A programming technique that implicitly defines a function object class and constructs a function object of that class type.

语句Statements
表达式、null、复合、选择、迭代、跳转和声明语句。Expression, null, compound, selection, iteration, jump, and declaration statements.

类和结构Classes and structs
介绍类、结构和联合。Introduction to classes, structures, and unions. 此外,成员函数、特殊成员函数、数据成员、位域、 this 指针和嵌套类。Also, member functions, special member functions, data members, bit fields, this pointer, nested classes.

UnionsUnions
用户定义的类型,其中所有成员共享相同的内存位置。User-defined types in which all members share the same memory location.

派生类Derived Classes
单个和多个继承、 virtual 函数、多个基类、 抽象 类、范围规则。Single and multiple inheritance, virtual functions, multiple base classes, abstract classes, scope rules. 另外, __super__interface 关键字。Also, the __super and __interface keywords.

成员访问控制Member-Access Control
控制对类成员的访问: publicprivateprotected 关键字。Controlling access to class members: public, private, and protected keywords. 友元函数和友元类。Friend functions and classes.

重载Overloading
重载运算符,运算符重载规则。Overloaded operators, rules for operator overloading.

异常处理Exception Handling
C++ 异常处理、结构化异常处理 (SEH)、编写异常处理语句所使用的关键字。C++ exception handling, structured exception handling (SEH), keywords used in writing exception handling statements.

断言和 User-Supplied 消息Assertion and User-Supplied Messages
#error 指令、 static_assert 关键字、 assert 宏。#error directive, the static_assert keyword, the assert macro.

模板Templates
模板规范、函数模板、类模板、 typename 关键字、模板与宏、模板和智能指针。Template specifications, function templates, class templates, typename keyword, templates vs. macros, templates and smart pointers.

事件处理Event Handling
声明事件和事件处理程序。Declaring events and event handlers.

Microsoft 专用的修饰符Microsoft-Specific Modifiers
Microsoft C++ 专用修饰符。Modifiers specific to Microsoft C++. 内存寻址、调用约定、 naked 函数、扩展的存储类属性 (__declspec) __w64Memory addressing, calling conventions, naked functions, extended storage-class attributes (__declspec), __w64.

内联汇编程序Inline Assembler
在块中使用汇编语言和 c + + __asmUsing assembly language and C++ in __asm blocks.

编译器 COM 支持Compiler COM Support
有关用于支持 COM 类型的 Microsoft 专用类和全局函数的参考。A reference to Microsoft-specific classes and global functions used to support COM types.

Microsoft 扩展Microsoft Extensions
Microsoft 的 C++ 扩展。Microsoft extensions to C++.

非标准行为Nonstandard Behavior
有关 Microsoft c + + 编译器的非标准行为的信息。Information about nonstandard behavior of the Microsoft C++ compiler.

欢迎回到 c + +Welcome Back to C++
概述用于编写安全、有效和有效程序的新式 c + + 编程做法。An overview of modern C++ programming practices for writing safe, correct and efficient programs.

适用于运行时平台的组件扩展Component Extensions for Runtime Platforms
有关使用 Microsoft c + + 编译器面向 .NET 的参考资料。Reference material on using the Microsoft C++ compiler to target .NET.

C/C++ 生成参考C/C++ Building Reference
编译器选项、链接器选项和其他生成工具。Compiler options, linker options, and other build tools.

C/c + + 预处理器参考C/C++ Preprocessor Reference
有关杂注、预处理器指令、预定义宏和预处理器的参考材料。Reference material on pragmas, preprocessor directives, predefined macros, and the preprocessor.

Visual C++ 库Visual C++ Libraries
指向各种 Microsoft c + + 库的引用起始页的链接的列表。A list of links to the reference start pages for the various Microsoft C++ libraries.

请参阅See also

C 语言参考C Language Reference