WTF
Go to the documentation of this file. 23 #ifndef WTF_VectorTraits_h 24 #define WTF_VectorTraits_h 33 template <
typename T>
struct IsPod {
static const bool value =
false; };
34 template <>
struct IsPod<bool> {
static const bool value =
true; };
35 template <>
struct IsPod<char> {
static const bool value =
true; };
36 template <>
struct IsPod<signed char> {
static const bool value =
true; };
37 template <>
struct IsPod<unsigned char> {
static const bool value =
true; };
38 template <>
struct IsPod<short> {
static const bool value =
true; };
39 template <>
struct IsPod<unsigned short> {
static const bool value =
true; };
40 template <>
struct IsPod<int> {
static const bool value =
true; };
41 template <>
struct IsPod<unsigned int> {
static const bool value =
true; };
42 template <>
struct IsPod<long> {
static const bool value =
true; };
43 template <>
struct IsPod<unsigned long> {
static const bool value =
true; };
44 template <>
struct IsPod<long long> {
static const bool value =
true; };
45 template <>
struct IsPod<unsigned long long> {
static const bool value =
true; };
46 template <>
struct IsPod<float> {
static const bool value =
true; };
47 template <>
struct IsPod<double> {
static const bool value =
true; };
48 template <>
struct IsPod<long double> {
static const bool value =
true; };
49 template <
typename P>
struct IsPod<P *> {
static const bool value =
true; };
51 template<
bool isPod,
typename T>
57 static const bool needsDestruction =
true;
58 static const bool needsInitialization =
true;
59 static const bool canInitializeWithMemset =
false;
60 static const bool canMoveWithMemcpy =
false;
61 static const bool canCopyWithMemcpy =
false;
62 static const bool canFillWithMemset =
false;
63 static const bool canCompareWithMemcmp =
false;
69 static const bool needsDestruction =
false;
70 static const bool needsInitialization =
false;
71 static const bool canInitializeWithMemset =
false;
72 static const bool canMoveWithMemcpy =
true;
73 static const bool canCopyWithMemcpy =
true;
74 static const bool canFillWithMemset =
sizeof(T) ==
sizeof(
char);
75 static const bool canCompareWithMemcmp =
true;
83 static const bool needsDestruction =
true;
84 static const bool needsInitialization =
true;
85 static const bool canInitializeWithMemset =
true;
86 static const bool canMoveWithMemcpy =
true;
87 static const bool canCopyWithMemcpy =
false;
88 static const bool canFillWithMemset =
false;
89 static const bool canCompareWithMemcmp =
true;
97 template<
typename First,
typename Second>
103 static const bool needsDestruction = FirstTraits::needsDestruction || SecondTraits::needsDestruction;
104 static const bool needsInitialization = FirstTraits::needsInitialization || SecondTraits::needsInitialization;
105 static const bool canInitializeWithMemset = FirstTraits::canInitializeWithMemset && SecondTraits::canInitializeWithMemset;
106 static const bool canMoveWithMemcpy = FirstTraits::canMoveWithMemcpy && SecondTraits::canMoveWithMemcpy;
107 static const bool canCopyWithMemcpy = FirstTraits::canCopyWithMemcpy && SecondTraits::canCopyWithMemcpy;
108 static const bool canFillWithMemset =
false;
109 static const bool canCompareWithMemcmp = FirstTraits::canCompareWithMemcmp && SecondTraits::canCompareWithMemcmp;
117 #endif // WTF_VectorTraits_h
VectorTraits< Second > SecondTraits
VectorTraits< First > FirstTraits
This file is part of the KDE documentation.
Documentation copyright © 1996-2017 The KDE developers.
Generated on Wed May 10 2017 11:01:12 by
doxygen 1.8.11 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.