Skip to content

Commit 91a733f

Browse files
author
mikeblome
committed
fixed up lexical conventions node
1 parent d8b152c commit 91a733f

8 files changed

Lines changed: 13337 additions & 13342 deletions

.openpublishing.redirection.json

Lines changed: 13292 additions & 13282 deletions
Large diffs are not rendered by default.

docs/cpp/auto-cpp.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "auto (C++)"
3-
ms.date: "11/04/2016"
3+
ms.date: "12/10/2019"
44
f1_keywords: ["auto_CPP", "auto"]
55
helpviewer_keywords: ["auto keyword [C++]"]
66
ms.assetid: e9d495d7-601c-4547-b897-998389a311f4
@@ -9,6 +9,9 @@ ms.assetid: e9d495d7-601c-4547-b897-998389a311f4
99

1010
Deduces the type of a declared variable from its initialization expression.
1111

12+
> [!NOTE]
13+
> The C++ standard defines an original and a revised meaning for this keyword. Before Visual Studio 2010, the **auto** keyword declares a variable in the *automatic* storage class; that is, a variable that has a local lifetime. Starting with Visual Studio 2010, the **auto** keyword declares a variable whose type is deduced from the initialization expression in its declaration. The [/Zc:auto[-]](../build/reference/zc-auto-deduce-variable-type.md) compiler option controls the meaning of the **auto** keyword.
14+
1215
## Syntax
1316

1417
```

docs/cpp/auto-keyword.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/cpp/character-sets.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
---
2-
title: "Character Sets"
3-
ms.date: "05/06/2019"
4-
helpviewer_keywords: ["Character sets", "basic source character set (C++)", "universal character names", "basic execution character set (C++)"]
2+
title: "Tokens and character Sets"
3+
ms.date: "12/10/2019"
4+
helpviewer_keywords: ["Tokens (C++), "Character sets", "basic source character set (C++)", "universal character names", "basic execution character set (C++)"]
55
ms.assetid: 379a2af6-6422-425f-8352-ef0bca6c0d74
66
---
7-
# Character Sets
7+
# Tokens and character Sets
88

9-
The text of a C++ program is stored in source files that use a particular character encoding. The C++ standard specifies a basic source character set for source files and a basic execution character set for compiled files. The Microsoft C++ compiler (MSVC) allows an additional set of locale-specific characters to be used in source files and compiled files.
9+
The text of a C++ program consists of tokens and *white space*. A token is the smallest element of a C++ program that is meaningful to the compiler. The C++ parser recognizes these kinds of tokens:
1010

11-
## Character sets
11+
- [Keywords](../cpp/keywords-cpp.md)
12+
- [Identifiers](../cpp/identifiers-cpp.md)
13+
- [Numeric, Boolean and Pointer Literals](../cpp/numeric-boolean-and-pointer-literals-cpp.md)
14+
- [String and Character Literals](../cpp/string-and-character-literals-cpp.md)
15+
- [User-Defined Literals](../cpp/user-defined-literals-cpp.md)
16+
- [Operators](../cpp/cpp-built-in-operators-precedence-and-associativity.md)
17+
- [Punctuators](../cpp/punctuators-cpp.md)
1218

13-
The C++ standard specifies a *basic source character set* that may be used in source files. To represent characters outside of this set, additional characters can be specified by using a *universal character name*. When compiled, the *basic execution character set* and *basic execution wide-character set* represent the characters and strings that can appear in a program. The MSVC implementation allows additional characters in source code and compiled code.
19+
Tokens are usually separated by *white space*, which can be one or more:
1420

15-
### Basic source character set
21+
- Blanks
22+
- Horizontal or vertical tabs
23+
- New lines
24+
- Form feeds
25+
- Comments
1626

17-
The *basic source character set* consists of 96 characters that may be used in source files. This set includes the space character, horizontal tab, vertical tab, form feed and new-line control characters, and this set of graphical characters:
27+
## Basic source character set
28+
29+
The C++ standard specifies a *basic source character set* that may be used in source files. To represent characters outside of this set, additional characters can be specified by using a *universal character name*. The MSVC implementation allows additional characters. The *basic source character set* consists of 96 characters that may be used in source files. This set includes the space character, horizontal tab, vertical tab, form feed and new-line control characters, and this set of graphical characters:
1830

1931
`a b c d e f g h i j k l m n o p q r s t u v w x y z`
2032

@@ -49,6 +61,6 @@ The format of extended characters on the Windows clipboard is specific to applic
4961

5062
**END Microsoft Specific**
5163

52-
### Basic execution character set
64+
### Execution character sets
5365

54-
The *basic execution character set* and the *basic execution wide-character set* consist of all the characters in the basic source character set, and the control characters that represent alert, backspace, carriage return, and the null character. The *execution character set* and *execution wide-character set* are supersets of the basic sets. They include the implementation-defined source characters outside the basic source character set. The execution character set has a locale-specific representation.
66+
The *execution character sets* represent the characters and strings that can appear in a compiled program. These character sets consist of all the characters permitted in a source file, and also the control characters that represent alert, backspace, carriage return, and the null character. The execution character set has a locale-specific representation.

docs/cpp/cpp-language-reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "C++ Language Reference"
33
ms.custom: "index-page"
4-
ms.date: "05/06/2019"
4+
ms.date: "12/10/2019"
55
helpviewer_keywords: ["C++, language reference"]
66
ms.assetid: 4be9cacb-c862-4391-894a-3a118c9c93ce
77
---
@@ -40,12 +40,12 @@ A programming technique that implicitly defines a function object class and cons
4040
[Statements](../cpp/statements-cpp.md)<br/>
4141
Expression, null, compound, selection, iteration, jump, and declaration statements.
4242

43-
[Declarations and Definitions](declarations-and-definitions-cpp.md)<br/>
44-
Storage-class specifiers, function definitions, initializations, enumerations, **class**, **struct**, and **union** declarations, and **typedef** declarations. Also, **inline** functions, **const** keyword, namespaces.
45-
46-
[Classes, Structures, and Unions](../cpp/classes-and-structs-cpp.md)<br/>
43+
[Classes and structs](../cpp/classes-and-structs-cpp.md)<br/>
4744
Introduction to classes, structures, and unions. Also, member functions, special member functions, data members, bit fields, **this** pointer, nested classes.
4845

46+
[Unions](unions.md)<br/>
47+
User-defined types in which all members share the same memory location.
48+
4949
[Derived Classes](../cpp/inheritance-cpp.md)<br/>
5050
Single and multiple inheritance, **virtual** functions, multiple base classes, **abstract** classes, scope rules. Also, the **__super** and **__interface** keywords.
5151

docs/cpp/tokens-cpp.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@ ms.assetid: aa812fd0-6d47-4f3f-aee0-db002ee4d8b9
66
---
77
# Tokens (C++)
88

9-
A token is the smallest element of a C++ program that is meaningful to the compiler. The C++ parser recognizes these kinds of tokens: identifiers, keywords, literals, operators, punctuators, and other separators. A stream of these tokens makes up a translation unit.
9+
A token is the smallest element of a C++ program that is meaningful to the compiler. The C++ parser recognizes these kinds of tokens:
10+
11+
- [Keywords](../cpp/keywords-cpp.md)
12+
- [Identifiers](../cpp/identifiers-cpp.md)
13+
- [Numeric, Boolean and Pointer Literals](../cpp/numeric-boolean-and-pointer-literals-cpp.md)
14+
- [String and Character Literals](../cpp/string-and-character-literals-cpp.md)
15+
- [User-Defined Literals](../cpp/user-defined-literals-cpp.md)
16+
- [Operators](../cpp/cpp-built-in-operators-precedence-and-associativity.md)
17+
- [Punctuators](../cpp/punctuators-cpp.md)
1018

1119
Tokens are usually separated by *white space*. White space can be one or more:
1220

1321
- Blanks
14-
1522
- Horizontal or vertical tabs
16-
1723
- New lines
18-
1924
- Form feeds
20-
2125
- Comments
2226

23-
The parser recognizes keywords, identifiers, literals, operators, and punctuators. For information on specific token types, see [Keywords](../cpp/keywords-cpp.md), [Identifiers](../cpp/identifiers-cpp.md), [Numeric, Boolean and Pointer Literals](../cpp/numeric-boolean-and-pointer-literals-cpp.md), [String and Character Literals](../cpp/string-and-character-literals-cpp.md), [User-Defined Literals](../cpp/user-defined-literals-cpp.md), [C++ Built-in Operators, Precedence and Associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md), and [Punctuators](../cpp/punctuators-cpp.md). White space is ignored, except as required to separate tokens.
27+
White space is ignored, except as required to separate tokens.
2428

2529
Preprocessing tokens are used in the preprocessing phases to generate the token stream passed to the compiler. The preprocessing token categories are header names, identifiers, preprocessing numbers, character literals, string literals, preprocessing operators and punctuators, and single non-white-space characters that do not match one of the other categories. Character and string literals can be user-defined literals. Preprocessing tokens can be separated by white space or comments.
2630

docs/cpp/user-defined-literals-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: "User-Defined Literals (C++)"
2+
title: "User-defined literals (C++)"
33
ms.date: "11/04/2016"
44
ms.assetid: ff4a5bec-f795-4705-a2c0-53788fd57609
55
---
6-
# User-Defined Literals (C++)
6+
# User-defined literals (C++)
77

88
There are five major categories of literals: integer, character, floating-point, string, boolean and pointer. Starting in C++ 11 you can define your own literals based on these categories to provide syntactic shortcuts for common idioms and increase type safety. For example, let's say you have a Distance class. You could define a literal for kilometers and another one for miles, and encourage the user to be explicit about the units of measure by simply writing: auto d = 42.0_km or auto d = 42.0_mi. There is no performance advantage or disadvantage to user-defined literals; they are primarily for convenience or for compile-time type deduction. The Standard Library has user-defined literals for std:string, for std::complex, and for units in time and duration operations in the \<chrono> header:
99

docs/toc.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3665,12 +3665,7 @@
36653665
- name: Identifiers
36663666
href: cpp/identifiers-cpp.md
36673667
- name: Keywords
3668-
expanded: false
3669-
items:
3670-
- name: Keywords
3671-
href: cpp/keywords-cpp.md
3672-
- name: auto keyword
3673-
href: cpp/auto-keyword.md
3668+
href: cpp/keywords-cpp.md
36743669
- name: Punctuators
36753670
href: cpp/punctuators-cpp.md
36763671
- name: Numeric, boolean, and pointer literals

0 commit comments

Comments
 (0)