|
template<typename T , typename D , T kInvalidHandle> |
void | std::swap (psystem::unique_handle< T, D, kInvalidHandle > &o1, psystem::unique_handle< T, D, kInvalidHandle > &o2) noexcept |
| Delegate std::swap calls for unique_handle to the member function. More...
|
|
template<typename T , typename D , T kInvalidHandle> |
bool | operator== (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
| Test for equality of two handles. More...
|
|
template<typename T , typename D , T kInvalidHandle> |
bool | operator!= (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
| Test for inequality of two handles. More...
|
|
template<typename T , typename D , T kInvalidHandle> |
bool | operator< (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
| Test if the first handle is less than the second. More...
|
|
template<typename T , typename D , T kInvalidHandle> |
bool | operator<= (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
| Test if the first handle is less than or equal to the second. More...
|
|
template<typename T , typename D , T kInvalidHandle> |
bool | operator> (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
| Test if the first handle is greater than the second. More...
|
|
template<typename T , typename D , T kInvalidHandle> |
bool | operator>= (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
| Test if the first handle is greater than or equal to the second. More...
|
|
Declare an RAII container for system API handles (psystem::unique_handle).
- Note
- There are no comparison operators for
unique_handle
to simple handle
types for a few reasons. First, it is difficult challenging (not impossible) to decide on a type for the unmanaged handle because handles are generally pointers or even integers that have been given another name via typedef. They may also be forward declarations of a type as well. The second reason is that many handle types will conflict with the bool
operator—the expression "unique_handle(hndl) == hndl"
may first convert the unique_handle
to a bool, then use a simple equality operator that compares POD integers, or it call the operator==
that takes unique_handle
and the handle type. There is ambiguity. We will therefore not defined these operators, and only compare unique_handle
to unique_handle
.
- Author
- Matt Bisson
- Date
- 5 August, 2014
- Since
- PSystem 2.0
- Version
- PSystem 2.0
- Copyright
- This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
template<typename T , typename D , T kInvalidHandle>
Test for inequality of two handles.
This ignores any deleter instance in the unique_handle.
Inequality is defined in terms of operator=().
- Template Parameters
-
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
- Parameters
-
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
- Returns
- The value of the comparison.
template<typename T , typename D , T kInvalidHandle>
Test if the first handle is less than the second.
This ignores any deleter instance in the unique_handle.
This comparison is defined in terms of std::less
.
- Template Parameters
-
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
- Parameters
-
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
- Returns
- The value of the comparison.
template<typename T , typename D , T kInvalidHandle>
Test if the first handle is less than or equal to the second.
This ignores any deleter instance in the unique_handle.
This comparison is defined in terms of operator<()
- Template Parameters
-
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
- Parameters
-
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
- Returns
- The value of the comparison.
template<typename T , typename D , T kInvalidHandle>
Test if the first handle is greater than the second.
This ignores any deleter instance in the unique_handle.
This comparison is defined in terms of operator<()
- Template Parameters
-
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
- Parameters
-
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
- Returns
- The value of the comparison.
template<typename T , typename D , T kInvalidHandle>
Test if the first handle is greater than or equal to the second.
This ignores any deleter instance in the unique_handle.
This comparison is defined in terms of operator<()
- Template Parameters
-
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
- Parameters
-
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
- Returns
- The value of the comparison.