Skip to content

Repo sync for protected branch #4815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 17, 2023
10 changes: 5 additions & 5 deletions docs/error-messages/compiler-warnings/c5267.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "Compiler warning 3 C5267"
title: "Compiler warning C5267"
description: Learn about compiler warning C5267
ms.date: 11/08/2023
f1_keywords: ["C5267"]
helpviewer_keywords: ["C5267"]
---
# Compiler warning C5267
# Compiler warning (level 4) C5267

> definition of implicit copy constructor/assignment operator for '*type*' is deprecated because it has a user-provided assignment operator/copy constructor

Expand All @@ -19,21 +19,21 @@ The relevant sections in the C++ standard are:

## Example

The following code shows warning C5267 when an implicitly generated special function is called but isn't explicitly defined:
The following code shows warning C5267 when an implicitly generated special function is called but isn't explicitly defined. Both `/W4` and `/w45267` are required to produce this warning.

```cpp
// C5267.cpp
// compile using: /W4 /w45267
struct CopyCtorOnly
{
CopyCtorOnly() = default;
CopyCtorOnly(const CopyCtorOnly&) {} // C5267
CopyCtorOnly(const CopyCtorOnly&) {} // C5267
};

struct CopyAssignOpOnly
{
CopyAssignOpOnly() = default;
CopyAssignOpOnly& operator=(const CopyAssignOpOnly&) // C5267
CopyAssignOpOnly& operator=(const CopyAssignOpOnly&) // C5267
{
return *this;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/error-messages/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4363,7 +4363,7 @@ items:
href: compiler-warnings/c5248.md
- name: Compiler warning (level 1, error, off) C5262
href: compiler-warnings/c5262.md
- name: Compiler warning C5267
- name: Compiler warning (level 4) C5267
href: compiler-warnings/c5267.md
- name: Compiler warning (level 1) C5301 and C5302
href: compiler-warnings/c5301-c5302.md
Expand Down
115 changes: 57 additions & 58 deletions docs/mfc/reference/cd2dbrush-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ title: "CD2DBrush Class"
ms.date: "11/04/2016"
f1_keywords: ["CD2DBrush", "AFXRENDERTARGET/CD2DBrush", "AFXRENDERTARGET/CD2DBrush::CD2DBrush", "AFXRENDERTARGET/CD2DBrush::Attach", "AFXRENDERTARGET/CD2DBrush::Destroy", "AFXRENDERTARGET/CD2DBrush::Detach", "AFXRENDERTARGET/CD2DBrush::Get", "AFXRENDERTARGET/CD2DBrush::GetOpacity", "AFXRENDERTARGET/CD2DBrush::GetTransform", "AFXRENDERTARGET/CD2DBrush::IsValid", "AFXRENDERTARGET/CD2DBrush::SetOpacity", "AFXRENDERTARGET/CD2DBrush::SetTransform", "AFXRENDERTARGET/CD2DBrush::m_pBrush", "AFXRENDERTARGET/CD2DBrush::m_pBrushProperties"]
helpviewer_keywords: ["CD2DBrush [MFC], CD2DBrush", "CD2DBrush [MFC], Attach", "CD2DBrush [MFC], Destroy", "CD2DBrush [MFC], Detach", "CD2DBrush [MFC], Get", "CD2DBrush [MFC], GetOpacity", "CD2DBrush [MFC], GetTransform", "CD2DBrush [MFC], IsValid", "CD2DBrush [MFC], SetOpacity", "CD2DBrush [MFC], SetTransform", "CD2DBrush [MFC], m_pBrush", "CD2DBrush [MFC], m_pBrushProperties"]
ms.assetid: 0d2c0857-2261-48a8-8ee0-a88cbf08499a
---
# CD2DBrush Class
# `CD2DBrush` Class

A wrapper for ID2D1Brush.
A wrapper for `ID2D1Brush`.

## Syntax

Expand All @@ -22,57 +21,57 @@ class CD2DBrush : public CD2DResource;

|Name|Description|
|----------|-----------------|
|[CD2DBrush::CD2DBrush](#cd2dbrush)|Constructs a CD2DBrush object.|
|[CD2DBrush::~CD2DBrush](#_dtorcd2dbrush)|The destructor. Called when a D2D brush object is being destroyed.|
|[`CD2DBrush::CD2DBrush`](#cd2dbrush)|Constructs a `CD2DBrush` object.|
|[`CD2DBrush::~CD2DBrush`](#_dtorcd2dbrush)|The destructor. Called when a D2D brush object is being destroyed.|

### Public Methods

|Name|Description|
|----------|-----------------|
|[CD2DBrush::Attach](#attach)|Attaches existing resource interface to the object|
|[CD2DBrush::Destroy](#destroy)|Destroys a CD2DBrush object. (Overrides [CD2DResource::Destroy](../../mfc/reference/cd2dresource-class.md#destroy).)|
|[CD2DBrush::Detach](#detach)|Detaches resource interface from the object|
|[CD2DBrush::Get](#get)|Returns ID2D1Brush interface|
|[CD2DBrush::GetOpacity](#getopacity)|Gets the degree of opacity of this brush|
|[CD2DBrush::GetTransform](#gettransform)|Gets the current transform of the render target|
|[CD2DBrush::IsValid](#isvalid)|Checks resource validity (Overrides [CD2DResource::IsValid](../../mfc/reference/cd2dresource-class.md#isvalid).)|
|[CD2DBrush::SetOpacity](#setopacity)|Sets the degree of opacity of this brush|
|[CD2DBrush::SetTransform](#settransform)|Applies the specified transform to the render target, replacing the existing transformation. All subsequent drawing operations occur in the transformed space|
|[`CD2DBrush::Attach`](#attach)|Attaches existing resource interface to the object|
|[`CD2DBrush::Destroy`](#destroy)|Destroys a `CD2DBrush` object. (Overrides [`CD2DResource::Destroy`](../../mfc/reference/cd2dresource-class.md#destroy).)|
|[`CD2DBrush::Detach`](#detach)|Detaches resource interface from the object|
|[`CD2DBrush::Get`](#get)|Returns `ID2D1Brush` interface|
|[`CD2DBrush::GetOpacity`](#getopacity)|Gets the degree of opacity of this brush|
|[`CD2DBrush::GetTransform`](#gettransform)|Gets the current transform of the brush|
|[`CD2DBrush::IsValid`](#isvalid)|Checks resource validity (Overrides [`CD2DResource::IsValid`](../../mfc/reference/cd2dresource-class.md#isvalid).)|
|[`CD2DBrush::SetOpacity`](#setopacity)|Sets the degree of opacity of this brush|
|[`CD2DBrush::SetTransform`](#settransform)|Applies the specified transform to the brush, replacing the existing transformation. All subsequent drawing operations occur in the transformed space|

### Public Operators

|Name|Description|
|----------|-----------------|
|[CD2DBrush::operator ID2D1Brush*](#operator_id2d1brush_star)|Returns ID2D1Brush interface|
|[`CD2DBrush::operator ID2D1Brush*`](#operator_id2d1brush_star)|Returns `ID2D1Brush` interface|

### Protected Data Members

|Name|Description|
|----------|-----------------|
|[CD2DBrush::m_pBrush](#m_pbrush)|Stores a pointer to an ID2D1Brush object.|
|[CD2DBrush::m_pBrushProperties](#m_pbrushproperties)|Brush properties.|
|[`CD2DBrush::m_pBrush`](#m_pbrush)|Stores a pointer to an `ID2D1Brush` object.|
|[`CD2DBrush::m_pBrushProperties`](#m_pbrushproperties)|Brush properties.|

## Inheritance Hierarchy

[CObject](../../mfc/reference/cobject-class.md)
[`CObject`](../../mfc/reference/cobject-class.md)

[CD2DResource](../../mfc/reference/cd2dresource-class.md)
[`CD2DResource`](../../mfc/reference/cd2dresource-class.md)

`CD2DBrush`

## Requirements

**Header:** afxrendertarget.h
**Header:** `afxrendertarget.h`

## <a name="_dtorcd2dbrush"></a> CD2DBrush::~CD2DBrush
## <a name="_dtorcd2dbrush"></a> `CD2DBrush::~CD2DBrush`

The destructor. Called when a D2D brush object is being destroyed.
The destructor. Called when a `D2D` brush object is being destroyed.

```
virtual ~CD2DBrush();
```

## <a name="attach"></a> CD2DBrush::Attach
## <a name="attach"></a> `CD2DBrush::Attach`

Attaches existing resource interface to the object.

Expand All @@ -82,12 +81,12 @@ void Attach(ID2D1Brush* pResource);

### Parameters

*pResource*<br/>
Existing resource interface. Cannot be NULL.
*`pResource`*\
Existing resource interface. Can't be `NULL`.

## <a name="cd2dbrush"></a> CD2DBrush::CD2DBrush
## <a name="cd2dbrush"></a> `CD2DBrush::CD2DBrush`

Constructs a CD2DBrush object.
Constructs a `CD2DBrush` object.

```
CD2DBrush(
Expand All @@ -98,24 +97,24 @@ CD2DBrush(

### Parameters

*pParentTarget*<br/>
*`pParentTarget`*\
A pointer to the render target.

*pBrushProperties*<br/>
*`pBrushProperties`*\
A pointer to the opacity and transformation of a brush.

*bAutoDestroy*<br/>
Indicates that the object will be destroyed by owner (pParentTarget).
*`bAutoDestroy`*\
Indicates that the owner (`pParentTarget`) destroys the object.

## <a name="destroy"></a> CD2DBrush::Destroy
## <a name="destroy"></a> `CD2DBrush::Destroy`

Destroys a CD2DBrush object.
Destroys a `CD2DBrush` object.

```
virtual void Destroy();
```

## <a name="detach"></a> CD2DBrush::Detach
## <a name="detach"></a> `CD2DBrush::Detach`

Detaches resource interface from the object.

Expand All @@ -127,19 +126,19 @@ ID2D1Brush* Detach();

Pointer to detached resource interface.

## <a name="get"></a> CD2DBrush::Get
## <a name="get"></a> `CD2DBrush::Get`

Returns ID2D1Brush interface
Returns `ID2D1Brush` interface

```
ID2D1Brush* Get();
```

### Return Value

Pointer to an ID2D1Brush interface or NULL if object is not initialized yet.
Pointer to an `ID2D1Brush` interface or `NULL` if object isn't initialized yet.

## <a name="getopacity"></a> CD2DBrush::GetOpacity
## <a name="getopacity"></a> `CD2DBrush::GetOpacity`

Gets the degree of opacity of this brush

Expand All @@ -149,22 +148,22 @@ FLOAT GetOpacity() const;

### Return Value

A value between zero and 1 that indicates the opacity of the brush. This value is a constant multiplier that linearly scales the alpha value of all pixels filled by the brush. The opacity values are clamped in the range 0 to 1 before they are multiplied together.
A value between zero and 1 that indicates the opacity of the brush. This value is a constant multiplier that linearly scales the alpha value of all pixels filled by the brush. The opacity values are clamped in the range 0 to 1 before they're multiplied together.

## <a name="gettransform"></a> CD2DBrush::GetTransform
## <a name="gettransform"></a> `CD2DBrush::GetTransform`

Gets the current transform of the render target
Gets the current transform of the brush

```cpp
void GetTransform(D2D1_MATRIX_3X2_F* transform) const;
```

### Parameters

*transform*<br/>
When this returns, contains the current transform of the render target. This parameter is passed uninitialized.
*`transform`*\
When this returns, contains the current transform of the brush. This parameter is passed uninitialized.

## <a name="isvalid"></a> CD2DBrush::IsValid
## <a name="isvalid"></a> `CD2DBrush::IsValid`

Checks resource validity

Expand All @@ -174,37 +173,37 @@ virtual BOOL IsValid() const;

### Return Value

TRUE if resource is valid; otherwise FALSE.
`TRUE` if resource is valid; otherwise `FALSE`.

## <a name="m_pbrush"></a> CD2DBrush::m_pBrush
## <a name="m_pbrush"></a> `CD2DBrush::m_pBrush`

Stores a pointer to an ID2D1Brush object.
Stores a pointer to an `ID2D1Brush` object.

```
ID2D1Brush* m_pBrush;
```

## <a name="m_pbrushproperties"></a> CD2DBrush::m_pBrushProperties
## <a name="m_pbrushproperties"></a> `CD2DBrush::m_pBrushProperties`

Brush properties.

```
CD2DBrushProperties* m_pBrushProperties;
```

## <a name="operator_id2d1brush_star"></a> CD2DBrush::operator ID2D1Brush*
## <a name="operator_id2d1brush_star"></a> `CD2DBrush::operator ID2D1Brush*`

Returns ID2D1Brush interface
Returns `ID2D1Brush` interface

```
operator ID2D1Brush*();
```

### Return Value

Pointer to an ID2D1Brush interface or NULL if object is not initialized yet.
Pointer to an `ID2D1Brush` interface or NULL if object isn't initialized yet.

## <a name="setopacity"></a> CD2DBrush::SetOpacity
## <a name="setopacity"></a> `CD2DBrush::SetOpacity`

Sets the degree of opacity of this brush

Expand All @@ -214,21 +213,21 @@ void SetOpacity(FLOAT opacity);

### Parameters

*opacity*<br/>
A value between zero and 1 that indicates the opacity of the brush. This value is a constant multiplier that linearly scales the alpha value of all pixels filled by the brush. The opacity values are clamped in the range 0 to 1 before they are multiplied together.
*`opacity`*\
A value between zero and 1 that indicates the opacity of the brush. This value is a constant multiplier that linearly scales the alpha value of all pixels filled by the brush. The opacity values are clamped in the range 0 to 1 before they're multiplied together.

## <a name="settransform"></a> CD2DBrush::SetTransform
## <a name="settransform"></a> `CD2DBrush::SetTransform`

Applies the specified transform to the render target, replacing the existing transformation. All subsequent drawing operations occur in the transformed space.
Applies the specified transform to the brush, replacing the existing transformation. All subsequent drawing operations occur in the transformed space.

```cpp
void SetTransform(const D2D1_MATRIX_3X2_F* transform);
```

### Parameters

*transform*<br/>
The transform to apply to the render target
*`transform`*\
The transform to apply to the brush

## See also

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn more about: Compiler warnings that are off by default"
title: "Compiler warnings that are off by default"
ms.date: 02/28/2023
ms.date: 11/15/2023
helpviewer_keywords: ["warnings, compiler", "cl.exe compiler, setting options"]
---
# Compiler warnings that are off by default
Expand Down Expand Up @@ -190,7 +190,7 @@ The following warnings are turned off by default in Visual Studio 2022 and later
| [C5262](../error-messages/compiler-warnings/c5262.md) (level 1, error) | implicit fall-through occurs here; are you missing a `break` statement? Use `[[fallthrough]]` when a `break` statement is intentionally omitted between cases <sup>17.4</sup> |
| C5263 (level 4) | calling '`std::move`' on a temporary object prevents copy elision <sup>17.4</sup> |
| C5264 (level 4) | '*variable-name*': 'const' variable is not used <sup>17.4</sup> |
| [C5267](../error-messages/compiler-warnings/c5267.md) | definition of implicit copy constructor/assignment operator for '*type*' is deprecated because it has a user-provided assignment operator/copy constructor <sup>17.7</sup> |
| [C5267](../error-messages/compiler-warnings/c5267.md) (level 4) | definition of implicit copy constructor/assignment operator for '*type*' is deprecated because it has a user-provided assignment operator/copy constructor <sup>17.7</sup> |

<sup>14.1</sup> This warning is available starting in Visual Studio 2015 Update 1.\
<sup>14.3</sup> This warning is available starting in Visual Studio 2015 Update 3.\
Expand Down