HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
traits.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_BASE_GF_TRAITS_H
8 #define PXR_BASE_GF_TRAITS_H
9 
10 #include "pxr/pxr.h"
11 
12 #include <type_traits>
13 
15 
16 /// A metafunction with a static const bool member 'value' that is true for
17 /// GfVec types, like GfVec2i, GfVec4d, etc and false for all other types.
18 template <class T>
19 struct GfIsGfVec { static const bool value = false; };
20 
21 /// A metafunction with a static const bool member 'value' that is true for
22 /// GfMatrix types, like GfMatrix3d, GfMatrix4f, etc and false for all other
23 /// types.
24 template <class T>
25 struct GfIsGfMatrix { static const bool value = false; };
26 
27 /// A metafunction with a static const bool member 'value' that is true for
28 /// GfQuat types and false for all other types.
29 template <class T>
30 struct GfIsGfQuat { static const bool value = false; };
31 
32 /// A metafunction with a static const bool member 'value' that is true for
33 /// GfDualQuat types and false for all other types.
34 template <class T>
35 struct GfIsGfDualQuat { static const bool value = false; };
36 
37 /// A metafunction with a static const bool member 'value' that is true for
38 /// GfRange types and false for all other types.
39 template <class T>
40 struct GfIsGfRange { static const bool value = false; };
41 
42 /// A metafunction which is equivalent to std::is_floating_point but
43 /// allows for additional specialization for types like GfHalf
44 template <class T>
46 
47 /// A metafunction which is equivalent to std::arithmetic but
48 /// also includes any specializations from GfIsFloatingPoint (like GfHalf)
49 template <class T>
50 struct GfIsArithmetic : public std::integral_constant<
51  bool, GfIsFloatingPoint<T>::value || std::is_arithmetic<T>::value>{};
52 
54 
55 #endif // PXR_BASE_GF_TRAITS_H
GLsizei const GLfloat * value
Definition: glcorearb.h:824
bool_constant< std::is_floating_point< T >::value||is_float128< T >::value > is_floating_point
Definition: format.h:862
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74