Skip to content

Commit a883df9

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#716 from oldnewthing/patch-1
Correct Platform::Guid constructor and operators
2 parents b760cb2 + 94c41a2 commit a883df9

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

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

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Platform::Guid value class"
3-
ms.date: "12/30/2016"
3+
ms.date: "01/15/2019"
44
ms.topic: "reference"
55
f1_keywords: ["VCCORLIB/Platform::Guid"]
66
helpviewer_keywords: ["Platform::Guid Struct"]
@@ -24,12 +24,13 @@ Guid has the Equals(), GetHashCode(), and ToString() methods derived from the [P
2424
|------------|-----------------|
2525
|[Guid](#ctor)|Initializes a new instance of the Guid struct.|
2626
|[operator==](#operator-equality)|Equals operator.|
27-
|[operator!=](#operator-not-equal)|Not equals operator.|
27+
|[operator!=](#operator-inequality)|Not equals operator.|
28+
|[operator<](#operator-less)|Less than operator.|
2829
|[operator()](#operator-call)|Converts a Guid to a GUID.|
2930
3031
### Remarks
3132
32-
For an example of how to generate a new Platform::Guid using the Windows function [CoCreateGuid](/windows/desktop/api/combaseapi/nf-combaseapi-cocreateguid), see [WinRT component: How to generate a GUID?](http://blogs.msdn.com/b/eternalcoding/archive/2013/03/25/winrt-component-how-to-generate-a-guid.aspx)
33+
For an example of how to generate a new Platform::Guid using the Windows function [CoCreateGuid](/windows/desktop/api/combaseapi/nf-combaseapi-cocreateguid), see [WinRT component: How to generate a GUID?](https://www.eternalcoding.com/?p=383)
3334
3435
### Requirements
3536
@@ -106,19 +107,19 @@ The next byte of the GUID.
106107
The next byte of the GUID.
107108

108109
*m*<br/>
109-
A GUID as defined.
110+
A GUID in the form a [GUID structure](https://msdn.microsoft.com/library/windows/desktop/aa373931).
110111

111112
*n*<br/>
112113
The remaining 8 bytes of the GUID.
113114

114115
## <a name="operator-equality"></a> Guid::operator== Operator
115116

116-
Compares two guids.
117+
Compares two guids for equality.
117118

118119
### Syntax
119120

120121
```cpp
121-
Platform::Guid::operator==
122+
static bool Platform::Guid::operator==(Platform::Guid guid1, Platform::Guid guid2);
122123
```
123124

124125
### Return Value
@@ -127,32 +128,48 @@ True if the two guids are equal.
127128

128129
## <a name="operator-inequality"></a> Guid::operator!= Operator
129130

130-
Compares two guids.
131+
Compares two guids for inequality.
131132

132133
### Syntax
133134

134135
```cpp
135-
Platform::Guid::operator!=
136+
static bool Platform::Guid::operator!=(Platform::Guid guid1, Platform::Guid guid2);
136137
```
137138

138139
### Return Value
139140

140141
True if the two guids are not equal.
141142

143+
## <a name="operator-less"></a> Guid::operator&lt; Operator
144+
145+
Compares two guids for ordering.
146+
147+
### Syntax
148+
149+
```cpp
150+
static bool Platform::Guid::operator<(Platform::Guid guid1, Platform::Guid guid2);
151+
```
152+
153+
### Return Value
154+
155+
True if the first guid is ordered before the second guid. The ordering is lexicographic after treating the Guid as if it were an array of four 32-bit unsigned values. Note that this is not the same ordering used by SQL Server, nor is it the same ordering used by the .NET Framework, nor is it the same as lexicographical ordering by string representation.
156+
157+
This operator is provided so that Guid objects can be more easily consumed by the C++ standard library.
158+
142159
## <a name="operator-call"></a> Guid::operator() Operator
143160

144-
Implicitly converts a [GUID structure](https://msdn.microsoft.com/library/windows/desktop/aa373931)GUID to a Platform::Guid.
161+
Implicitly converts a Platform::Guid to a [GUID structure](https://msdn.microsoft.com/library/windows/desktop/aa373931).
145162

146163
### Syntax
147164

148165
```cpp
149-
Platform::Guid operator();
166+
const GUID& Platform::Guid::operator();
150167
```
151168

152169
### Return Value
153170

154-
A Guid struct.
171+
A [GUID structure](https://msdn.microsoft.com/library/windows/desktop/aa373931).
155172

156173
## See Also
157174

158-
[Platform namespace](../cppcx/platform-namespace-c-cx.md)
175+
[Platform namespace](../cppcx/platform-namespace-c-cx.md)

0 commit comments

Comments
 (0)