|
HDK
|
#include "pxr/pxr.h"#include <map>#include <type_traits>#include <unordered_map>#include <utility>#include <vector>
Include dependency graph for traits.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Typedefs | |
| template<typename T > | |
| using | VdfByValueOrConstRef = typename std::conditional_t< std::is_pointer_v< T >||Vdf_AndTypeIsSmall< T, std::is_arithmetic_v< T >>||Vdf_AndTypeIsSmall< T, std::is_enum_v< T >>, T, const T & > |
Variables | |
| template<typename , typename = void> | |
| PXR_NAMESPACE_OPEN_SCOPE constexpr bool | Vdf_IsEqualityComparableHelper = false |
| template<typename T > | |
| constexpr bool | VdfIsEqualityComparable |
| template<typename , bool > | |
| constexpr bool | Vdf_AndTypeIsSmall = false |
| template<typename T > | |
| constexpr bool | Vdf_AndTypeIsSmall< T, true > = sizeof(T) <= sizeof(void*) |
| using VdfByValueOrConstRef = typename std::conditional_t< std::is_pointer_v<T> || Vdf_AndTypeIsSmall<T, std::is_arithmetic_v<T>> || Vdf_AndTypeIsSmall<T, std::is_enum_v<T>>, T, const T &> |
Template that evaluates to either T or const T & depending on whether T best be passed as value or const reference.
The heuristic here is as follows:
T if T is a ptr, arithmetic type, or enum, and also <= size of a ptrconst T & in all other casesNote that this heuristic is a best guess given a generic type T, but if the type is known the call site may be able to make a more informed decision on how to pass parameters and return values without the use of this facility.
| constexpr bool Vdf_AndTypeIsSmall = false |
| constexpr bool Vdf_AndTypeIsSmall< T, true > = sizeof(T) <= sizeof(void*) |
| PXR_NAMESPACE_OPEN_SCOPE constexpr bool Vdf_IsEqualityComparableHelper = false |
| constexpr bool VdfIsEqualityComparable |
Variable template that returns true if equality comparison is a valid operation for type T.
For compound types, specializations must be provided along the lines of the following example:
```cpp // ContainerType<T> is equality comparable iff T is equality comparable. template <typename t>=""> constexpr bool VdfIsEqualityComparable<ContainerType<T>> = VdfIsEqualityComparable<T>; ```