You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
10
10
11
11
> [!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).
14
13
15
-
###Example
14
+
## Example
16
15
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.
20
17
18
+
```cpp
21
19
namespacewfm = Windows::Foundation::Metadata;
22
20
23
21
public ref class Bicycle sealed
@@ -33,29 +31,29 @@ public:
33
31
34
32
## Supported targets
35
33
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:
37
35
38
36
:::row:::
39
37
:::column span="":::
40
38
class\
41
-
delegate\
42
39
enum\
43
-
enum field\
44
40
event\
45
-
interface
41
+
method\
42
+
property\
43
+
struct field
46
44
:::column-end:::
47
45
:::column span="":::
48
-
method\
46
+
delegate\
47
+
enum field\
48
+
interface\
49
49
parameterized constructor\
50
-
property\
51
50
struct\
52
-
struct field\
53
51
XAML control
54
52
:::column-end:::
55
53
:::row-end:::
56
54
57
55
## See also
58
56
59
-
[Type System](../cppcx/type-system-c-cx.md)<br/>
60
-
[C++/CX Language Reference](../cppcx/visual-c-language-reference-c-cx.md)<br/>
0 commit comments