Skip to content

Commit ff0a246

Browse files
committed
Merging changes synced from https://github.com/MicrosoftDocs/cpp-docs-pr (branch live)
2 parents aaf1be8 + a8297be commit ff0a246

File tree

2 files changed

+66
-66
lines changed

2 files changed

+66
-66
lines changed
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
---
22
description: "Learn more about: Deprecating types and members (C++/CX)"
33
title: "Deprecating types and members (C++/CX)"
4-
ms.date: "12/30/2016"
5-
ms.assetid: b20b01c1-a439-4ff0-8cf3-d7280c492813
4+
ms.date: 01/07/2022
5+
no-loc: [ "class", "delegate", "enum", "field", "interface", "method", "property", "struct" ]
66
---
77
# Deprecating types and members (C++/CX)
88

9-
In C++/CX, deprecation of Windows Runtime types and members for producers and consumers by using the [Deprecated](/uwp/api/windows.foundation.metadata.deprecatedattribute) attribute is supported. If you consume an API to which this attribute has been applied, you get a compile-time warning message that indicates that the API is deprecated and also recommends an alternative API to use. In your own public types and methods, you can apply this attribute and supply your own custom message.
9+
C++/CX supports deprecation of Windows Runtime types and members for producers and consumers by using the [`Deprecated`](/uwp/api/windows.foundation.metadata.deprecatedattribute) attribute. If you consume an API that has this attribute, you get a compile-time warning message. It indicates that the API is deprecated and also recommends an alternative API to use. In your own public types and methods, you can apply this attribute and supply your own custom message.
1010

1111
> [!CAUTION]
12-
> The [`Deprecated`](/uwp/api/windows.foundation.metadata.deprecatedattribute) attribute is for use only with Windows Runtime types. For standard C++ classes and members, use
13-
[`[[deprecated]]`](../cpp/deprecated-cpp.md) (C++14 and later) or [`__declspec(deprecated)`](../cpp/deprecated-cpp.md).
12+
> The [`Deprecated`](/uwp/api/windows.foundation.metadata.deprecatedattribute) attribute is for use only with Windows Runtime types. For standard C++ classes and members, use [`[[deprecated]]`](../cpp/deprecated-cpp.md) (C++14 and later) or [`__declspec(deprecated)`](../cpp/deprecated-cpp.md).
1413
15-
### Example
14+
## Example
1615

17-
The following example shows how to deprecate your own public APIs—for example, in a Windows Runtime component. The second parameter, of type [Windows:Foundation::Metadata::DeprecationType](/uwp/api/windows.foundation.metadata.deprecationtype) specifies whether the API is being deprecated or removed. Currently only the DeprecationType::Deprecated value is supported. The third parameter in the attribute specifies the [Windows::Foundation::Metadata::Platform](/uwp/api/windows.foundation.metadata.platformattribute) to which the attribute applies.
18-
19-
```
16+
The following example shows how to deprecate your own public APIs—for example, in a Windows Runtime component. The second parameter, of type [`Windows:Foundation::Metadata::DeprecationType`](/uwp/api/windows.foundation.metadata.deprecationtype) specifies whether the API is being deprecated or removed. Currently only the `DeprecationType::Deprecated` value is supported. The third parameter in the attribute specifies the [`Windows::Foundation::Metadata::Platform`](/uwp/api/windows.foundation.metadata.platformattribute) to which the attribute applies.
2017

18+
```cpp
2119
namespace wfm = Windows::Foundation::Metadata;
2220

2321
public ref class Bicycle sealed
@@ -33,29 +31,29 @@ public:
3331

3432
## Supported targets
3533

36-
The following table lists the constructs to which the Deprecated attribute may be applied:
34+
The following table lists the constructs to which the `Deprecated` attribute may be applied:
3735

3836
:::row:::
3937
:::column span="":::
4038
class\
41-
delegate\
4239
enum\
43-
enum field\
4440
event\
45-
interface
41+
method\
42+
property\
43+
struct field
4644
:::column-end:::
4745
:::column span="":::
48-
method\
46+
delegate\
47+
enum field\
48+
interface\
4949
parameterized constructor\
50-
property\
5150
struct\
52-
struct field\
5351
XAML control
5452
:::column-end:::
5553
:::row-end:::
5654

5755
## See also
5856

59-
[Type System](../cppcx/type-system-c-cx.md)<br/>
60-
[C++/CX Language Reference](../cppcx/visual-c-language-reference-c-cx.md)<br/>
61-
[Namespaces Reference](../cppcx/namespaces-reference-c-cx.md)
57+
[Type system (C++/CX)](../cppcx/type-system-c-cx.md)\
58+
[C++/CX language reference](../cppcx/visual-c-language-reference-c-cx.md)\
59+
[Namespaces reference](../cppcx/namespaces-reference-c-cx.md)

0 commit comments

Comments
 (0)