Skip to content

Commit 2c604f2

Browse files
authored
Merge pull request #210 from Microsoft/master
updated links to various topics, and f1 for C++/CX
2 parents b8d8cb0 + 8fc64ce commit 2c604f2

File tree

88 files changed

+360
-301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+360
-301
lines changed

docs/cpp/attributes2.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ void Foo(int);
2626
- `carries_dependency`--specifies that the function propagates data dependency ordering with respect to thread synchronization. The attribute can be applied to one or more parameters, to specify that the passed-in argument carries a dependency into the function body. The attribute can be applied to the function itself, to specify that the return value carries a dependency out of the function. The compiler can use this information to generate more efficient code.
2727

2828
- `deprecated` – specifies that a function is not intended to be used, and might not exist in future versions of a library interface. The compiler can use this to generate an informational message when client code attempts to call the function. Can be applied to declaration of a class, a typedef-name, a variable, a non-static data member, a function, a namespace, an enumeration, an enumerator, or a template specialization.
29+
30+
- `fallthrough` - **Visual Studio 2017 and later:**(available with [/std:c++latest](../build/reference/std-specify-language-standard-version.md)) The `[[fallthrough]]` attribute can be used in the context of [switch](switch-statement-cpp.md) statements as a hint to the compiler (or anyone reading the code) that the fallthrough behavior is intended. The Visual C++ compiler currently does not warn on fallthrough behavior, so this attribute has no effect compiler behavior.
31+
32+
**Microsoft-specific:**
2933

3034
- `gsl::suppress` -- this Microsoft-specific attribute is used for suppressing warnings from checkers that enforce [Guidelines Support Library (GSL)](https://github.com/Microsoft/GSL) rules in code. For example, consider the code snippet below
3135

docs/cpp/range-based-for-statement-cpp.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ Executes `statement` repeatedly and sequentially for each element in `expression
4242
```
4343

4444
## Remarks
45-
Use the range-based `for` statement to construct loops that must execute through a "range", which is defined as anything that you can iterate through—for example, `std::vector`, or any other C++ Standard Library sequence whose range is defined by a `begin()` and `end()`. The name that is declared in the `for-range-declaration` portion is local to the `for` statement and cannot be re-declared in `expression` or `statement`. Note that the [auto](../cpp/auto-cpp.md) keyword is preferred in the `for-range-declaration` portion of the statement.
45+
Use the range-based `for` statement to construct loops that must execute through a "range", which is defined as anything that you can iterate through—for example, `std::vector`, or any other C++ Standard Library sequence whose range is defined by a `begin()` and `end()`. The name that is declared in the `for-range-declaration` portion is local to the `for` statement and cannot be re-declared in `expression` or `statement`. Note that the [auto](../cpp/auto-cpp.md) keyword is preferred in the `for-range-declaration` portion of the statement.
46+
47+
**New in Visual Studio 2017:** Range-based for loops no longer require that begin() and end() return objects of the same type. This enables end() to return a sentinel object such as used by ranges as defined in the Ranges-V3 proposal. For more information, see [Generalizing the Range-Based For Loop](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0184r0.html) and the [range-v3 library on GitHub](https://github.com/ericniebler/range-v3).
4648

47-
This code shows how to use ranged `for` loops to iterate through an array and a vector:
49+
This code shows how to use range-based `for` loops to iterate through an array and a vector:
4850

4951
```cpp
5052
// range-based-for.cpp
@@ -78,7 +80,7 @@ int main()
7880
}
7981
cout << endl;
8082

81-
for( const auto &y : x ) { // Type inference by reference.
83+
for( const auto &y : x ) { // Type inference by const reference.
8284
// Observes in-place. Preferred when no modify is needed.
8385
cout << y << " ";
8486
}

docs/cpp/switch-statement-cpp.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,39 @@ int main() {
9999
}
100100
```
101101

102-
In the above example, `capa` is incremented if `c` is an uppercase `A`. The `break` statement after `capa++` terminates execution of the `switch` statement body and control passes to the `while` loop. Without the `break` statement, `lettera` and `nota` would also be incremented. A similar purpose is served by the `break` statement for `case 'a'`. If `c` is a lowercase `a`, `lettera` is incremented and the `break` statement terminates the `switch` statement body. If `c` is not an `a` or `A`, the `default` statement is executed.
102+
In the above example, `capa` is incremented if `c` is an uppercase `A`. The `break` statement after `capa++` terminates execution of the `switch` statement body and control passes to the `while` loop. Without the `break` statement, execution would "fall through" to the next labeled statement, so that `lettera` and `nota` would also be incremented. A similar purpose is served by the `break` statement for `case 'a'`. If `c` is a lowercase `a`, `lettera` is incremented and the `break` statement terminates the `switch` statement body. If `c` is not an `a` or `A`, the `default` statement is executed.
103+
104+
**Visual Studio 2017 and later:** (available with [/std:c++latest](../build/reference/std-specify-language-standard-version.md)) The `[[fallthrough]]` attribute is specified in the C++17 standard. It can be used in a `switch` statement as a hint to the compiler (or to anyone reading the code) that fall-through behavior is intended. The Visual C++ compiler currently does not warn on fallthrough behavior, so this attribute has no effect compiler behavior. Note that the attribute is applied to an empty statement within the labeled statement; in other words the semicolon is necessary.
105+
106+
```cpp
107+
int main()
108+
{
109+
int n = 5;
110+
switch (n)
111+
{
112+
113+
case 1:
114+
a();
115+
break;
116+
case 2:
117+
b();
118+
d();
119+
[[fallthrough]]; // I meant to do this!
120+
case 3:
121+
c();
122+
break;
123+
default:
124+
d();
125+
break;
126+
}
127+
128+
return 0;
129+
}
130+
```
103131

104132
An inner block of a `switch` statement can contain definitions with initializations as long as they are reachable — that is, not bypassed by all possible execution paths. Names introduced using these declarations have local scope. For example:
105133

106-
```
134+
```cpp
107135
// switch_statement2.cpp
108136
// C2360 expected
109137
#include <iostream>
@@ -137,7 +165,8 @@ int main(int argc, char *argv[])
137165
```
138166
139167
A `switch` statement can be nested. In such cases, **case** or **default** labels associate with the closest `switch` statement that encloses them.
140-
168+
169+
141170
## Microsoft Specific
142171
Microsoft C does not limit the number of case values in a `switch` statement. The number is limited only by the available memory. ANSI C requires at least 257 case labels be allowed in a `switch` statement.
143172

docs/cppcx/TOC.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
## [Weak references and breaking cycles (C++/CX)](weak-references-and-breaking-cycles-c-cx.md)
3434
## [Namespaces Reference (C++/CX)](namespaces-reference-c-cx.md)
3535
### [default namespace](default-namespace.md)
36-
#### [default::(type_name)::Equals Method](default-type-name-equals-method.md)
37-
#### [default::(type_name)::GetHashCode Method](default-type-name-gethashcode-method.md)
38-
#### [default::(type_name)::GetType Method](default-type-name-gettype-method.md)
39-
#### [default::(type_name)::ToString Method](default-type-name-tostring-method.md)
36+
#### [default::(type_name)::Equals](default-type-name-equals-method.md)
37+
#### [default::(type_name)::GetHashCode](default-type-name-gethashcode-method.md)
38+
#### [default::(type_name)::GetType](default-type-name-gettype-method.md)
39+
#### [default::(type_name)::ToString](default-type-name-tostring-method.md)
4040
### [Platform namespace (C++/CX)](platform-namespace-c-cx.md)
4141
#### [Platform::AccessDeniedException Class](platform-accessdeniedexception-class.md)
4242
#### [Platform::Agile Class](platform-agile-class.md)
@@ -69,7 +69,7 @@
6969
#### [Platform::OperationCanceledException Class](platform-operationcanceledexception-class.md)
7070
#### [Platform::OutOfBoundsException Class](platform-outofboundsexception-class.md)
7171
#### [Platform::OutOfMemoryException Class](platform-outofmemoryexception-class.md)
72-
#### [Platform::ReCreateException Method](platform-recreateexception-method.md)
72+
#### [Platform::ReCreateException](platform-recreateexception-method.md)
7373
#### [Platform::SizeT value class](platform-sizet-value-class.md)
7474
#### [Platform::STAThreadAttribute Class](platform-stathreadattribute-class.md)
7575
#### [Platform::String Class](platform-string-class.md)

docs/cppcx/collections-c-cx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void FindButton(UIElementCollection^ col)
9898
## Collection types
9999
Collections fall into four categories: modifiable versions and read-only versions of sequence collections and associative collections. In addition, C++/CX enhances collections by providing three iterator classes that simplify the accessing of collections.
100100

101-
Elements of a modifiable collection can be changed, but elements of a read-only collection, which is known as a *view*, can only be read. Elements of a [Platform::Collections::Vector](../cppcx/platform-collections-vector-class.md) or[Platform::Collections::VectorView](../cppcx/platform-collections-vectorview-class.md) collection can be accessed by using an iterator or the collection's [Vector::GetAt Method](../cppcx/platform-collections-vector-class.md#getat) and an index. Elements of an associative collection can be accessed by using the collection's [Map::Lookup Method](../cppcx/platform-collections-map-class.md#lookup) and a key.
101+
Elements of a modifiable collection can be changed, but elements of a read-only collection, which is known as a *view*, can only be read. Elements of a [Platform::Collections::Vector](../cppcx/platform-collections-vector-class.md) or[Platform::Collections::VectorView](../cppcx/platform-collections-vectorview-class.md) collection can be accessed by using an iterator or the collection's [Vector::GetAt](../cppcx/platform-collections-vector-class.md#getat) and an index. Elements of an associative collection can be accessed by using the collection's [Map::Lookup](../cppcx/platform-collections-map-class.md#lookup) and a key.
102102

103103
[Platform::Collections::Map Class](../cppcx/platform-collections-map-class.md)
104104
A modifiable, associative collection. Map elements are key-value pairs. Looking up a key to retrieve its associated value, and iterating through all key-value pairs, are both supported.

docs/cppcx/default-namespace.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ namespace default;
3232

3333
|||
3434
|-|-|
35-
|[default::(type_name)::Equals Method](../cppcx/default-type-name-equals-method.md)|Determines whether the specified object is equal to the current object.|
36-
|[default::(type_name)::GetHashCode Method](../cppcx/default-type-name-gethashcode-method.md)|Returns the hash code for this instance.|
37-
|[default::(type_name)::GetType Method](../cppcx/default-type-name-gettype-method.md)|Returns a string that represents the current type.|
38-
|[default::(type_name)::ToString Method](../cppcx/default-type-name-tostring-method.md)|Returns a string that represents the current type.|
35+
|[default::(type_name)::Equals](../cppcx/default-type-name-equals-method.md)|Determines whether the specified object is equal to the current object.|
36+
|[default::(type_name)::GetHashCode](../cppcx/default-type-name-gethashcode-method.md)|Returns the hash code for this instance.|
37+
|[default::(type_name)::GetType](../cppcx/default-type-name-gettype-method.md)|Returns a string that represents the current type.|
38+
|[default::(type_name)::ToString](../cppcx/default-type-name-tostring-method.md)|Returns a string that represents the current type.|
3939

4040
### Built-in types
4141

docs/cppcx/default-type-name-equals-method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
1111
f1_keywords:
12-
- "Platform/Platform::Object::Equals"
12+
- "VCCORLIB/Platform::Object::Equals"
1313
dev_langs:
1414
- "C++"
1515
ms.assetid: 4450f835-06fc-4758-8d0a-72cf00007873

docs/cppcx/default-type-name-gethashcode-method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
1111
f1_keywords:
12-
- "Platform/Platform::Object::GetHashCode"
12+
- "VCCORLIB/Platform::Object::GetHashCode"
1313
dev_langs:
1414
- "C++"
1515
ms.assetid: 58ea60f8-f820-4103-9b9b-b6635ada3fa5

docs/cppcx/default-type-name-gettype-method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
1111
f1_keywords:
12-
- "Platform/Platform::Object::GetType"
12+
- "VCCORLIB/Platform::Object::GetType"
1313
dev_langs:
1414
- "C++"
1515
ms.assetid: 21d0bf92-fac4-48cd-9108-c6f57ba1196a

docs/cppcx/default-type-name-tostring-method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
1111
f1_keywords:
12-
- "Platform/Platform::Object::ToString"
12+
- "VCCORLIB/Platform::Object::ToString"
1313
dev_langs:
1414
- "C++"
1515
ms.assetid: 2541955f-d844-4bd8-944d-185198c86579

docs/cppcx/exceptions-c-cx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ manager: "ghogen"
1616
---
1717
# Exceptions (C++/CX)
1818

19-
Error handling in C++/CX is based on exceptions. At the most fundamental level, [!INCLUDE[wrt](includes/wrt-md.md)] components report errors as HRESULT values. In C++/CX, these values are converted to strongly typed exceptions that contain an HRESULT value and a string description that you can access programmatically. Exceptions are implemented as a `ref class` that derives from `Platform::Exception`. The `Platform` namespace defines distinct exception classes for the most common HRESULT values; all other values are reported through the `Platform::COMException` class. All exception classes have an [Exception::HResult Property](platform-exception-class.md#hresult) field that you can use to retrieve the original HRESULT. You can also examine call-stack information for user code in the debugger that can help pinpoint the original source of the exception, even if it originated in code that was written in a language other than C++.
19+
Error handling in C++/CX is based on exceptions. At the most fundamental level, [!INCLUDE[wrt](includes/wrt-md.md)] components report errors as HRESULT values. In C++/CX, these values are converted to strongly typed exceptions that contain an HRESULT value and a string description that you can access programmatically. Exceptions are implemented as a `ref class` that derives from `Platform::Exception`. The `Platform` namespace defines distinct exception classes for the most common HRESULT values; all other values are reported through the `Platform::COMException` class. All exception classes have an [Exception::HResult](platform-exception-class.md#hresult) field that you can use to retrieve the original HRESULT. You can also examine call-stack information for user code in the debugger that can help pinpoint the original source of the exception, even if it originated in code that was written in a language other than C++.
2020

2121
## Exceptions
2222
In your C++ program, you can throw and catch an exception that comes from a [!INCLUDE[wrt](includes/wrt-md.md)] operation, an exception that's derived from `std::exception`, or a user-defined type. You have to throw a [!INCLUDE[wrt](includes/wrt-md.md)] exception only when it will cross the application binary interface (ABI) boundary, for example, when the code that catches your exception is written in JavaScript. When a non-[!INCLUDE[wrt](includes/wrt-md.md)] C++ exception reaches the ABI boundary, the exception is translated into a `Platform::FailureException` exception, which represents an E_FAIL HRESULT. For more information about the ABI, see [Creating Windows Runtime Components in C++](/MicrosoftDocs/windows-uwp/blob/docs/windows-apps-src/winrt-components/creating-windows-runtime-components-in-cpp.md).

docs/cppcx/platform-accessdeniedexception-class.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
1111
f1_keywords:
12-
- "Platform/Platform::AccessDeniedException"
13-
- "Platform/Platform::AccessDeniedException::AccessDeniedException"
12+
- "VCCORLIB/Platform::AccessDeniedException"
13+
- "VCCORLIB/Platform::AccessDeniedException::AccessDeniedException"
1414
dev_langs:
1515
- "C++"
1616
helpviewer_keywords:

docs/cppcx/platform-agile-class.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ ms.reviewer: ""
88
ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
11-
f1_keywords:
12-
- "agile/Platform::Agile"
11+
f1_keywords: ['AGILE/Platform::Platform', 'AGILE/Platform::Platform::Agile::Agile', 'AGILE/Platform::Platform::Agile::Get', 'AGILE/Platform::Platform::Agile::GetAddressOf', 'AGILE/Platform::Platform::Agile::GetAddressOfForInOut', 'AGILE/Platform::Platform::Agile::Release']
1312
dev_langs:
1413
- "C++"
1514
helpviewer_keywords:
@@ -45,7 +44,7 @@ class Agile;
4544

4645
|Name|Description|
4746
|----------|-----------------|
48-
|[Agile::Agile Constructor](#ctor)|Initializes a new instance of the Agile class.|
47+
|[Agile::Agile](#ctor)|Initializes a new instance of the Agile class.|
4948
|[Agile::~Agile Destructor](#dtor)|Destroys the current instance of the Agile class.|
5049

5150
### Public Methods
@@ -155,7 +154,7 @@ throw();
155154
### Remarks
156155
This operation releases the current representation of a object of type `T`, if any; reinitializes the Agile object's data members; acquires the current threading context; and then returns the address of a handle-to-object variable that can represent a non-agile object. To cause an Agile class instance to represent an object, use the assignment operator ([Agile::operator=](#operator-assign)) to assign the object to the Agile class instance.
157156

158-
## <a name="getaddressofforinput"></a> Agile::GetAddressOfForInOut Method
157+
## <a name="getaddressofforinout"></a> Agile::GetAddressOfForInOut Method
159158
Returns the address of a handle to the object represented by the current Agile object.
160159

161160
## Syntax

docs/cppcx/platform-array-class.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ ms.reviewer: ""
88
ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
11-
f1_keywords:
12-
- "vccorlib/Platform::Array"
11+
f1_keywords: ['VCCORLIB/Namespace not found::Platform', 'VCCORLIB/Namespace not found::Platform::Array Constructors', 'VCCORLIB/Namespace not found::Platform::Array::Value']
1312
dev_langs:
1413
- "C++"
1514
helpviewer_keywords:
@@ -48,7 +47,7 @@ private ref class Array<TArg, 1> :
4847
4948
|||
5049
|-|-|
51-
|[Array::Value Property](#value)|Retrieves a handle to the current array.|
50+
|[Array::Value](#value)|Retrieves a handle to the current array.|
5251
5352
### Remarks
5453
The Array class is sealed and cannot be inherited.

docs/cppcx/platform-arrayreference-class.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ ms.reviewer: ""
88
ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
11-
f1_keywords:
12-
- "Platform/Platform::ArrayReference"
11+
f1_keywords: ['VCCORLIB/Platform::ArrayReference::ArrayReference']
1312
dev_langs:
1413
- "C++"
1514
helpviewer_keywords:
@@ -35,7 +34,7 @@ class ArrayReference
3534
3635
|Name|Description|
3736
|----------|-----------------|
38-
|[ArrayReference::ArrayReference Constructor](#ctor)|Initializes a new instance of the `ArrayReference` class.|
37+
|[ArrayReference::ArrayReference](#ctor)|Initializes a new instance of the `ArrayReference` class.|
3938
4039
### Public Operators
4140

docs/cppcx/platform-boolean-value-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
1111
f1_keywords:
12-
- "Platform/Platform::Boolean"
12+
- "VCCORLIB/Platform::Boolean"
1313
dev_langs:
1414
- "C++"
1515
helpviewer_keywords:

docs/cppcx/platform-box-class.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
1111
f1_keywords:
12-
- "Platform/Platform::Box"
12+
- "VCCORLIB/Platform::Box"
1313
dev_langs:
1414
- "C++"
1515
ms.assetid: b3d7ea37-e98a-4fbc-80b0-ad35e50250c6
@@ -34,7 +34,7 @@ ref class Box abstract;
3434
**Namespace:** Platform
3535
|Member|Description|
3636
|------------|-----------------|
37-
|[Box Constructor](#ctor)|Creates a `Box` that can encapsulate a value of the specified type.|
37+
|[Box](#ctor)|Creates a `Box` that can encapsulate a value of the specified type.|
3838
|[operator Box&lt;const T&gt;^](#box-const-t)|Enables boxing conversions from a `const` value class `T` or `enum` class `T` to `Box<T>`.|
3939
|[operator Box&lt;const volatile T&gt;^](#box-const-volatile-t)|Enables boxing conversions from a `const volatile` value class `T` or `enum` type `T` to `Box<T>`. |
4040
|[operator Box&lt;T&gt;^](#box-t)|Enables boxing conversions from a value class `T` to `Box<T>`.|

docs/cppcx/platform-callbackcontext-enumeration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.suite: ""
99
ms.tgt_pltfrm: ""
1010
ms.topic: "language-reference"
1111
f1_keywords:
12-
- "Platform/Platform::CallbackContext"
12+
- "VCCORLIB/Platform::CallbackContext"
1313
dev_langs:
1414
- "C++"
1515
helpviewer_keywords:

0 commit comments

Comments
 (0)