29#ifndef PX_BASIC_TEMPLATES_H
30#define PX_BASIC_TEMPLATES_H
32#include "foundation/PxPreprocessor.h"
41 bool operator()(
const A& a,
const A& b)
const
50 bool operator()(
const A& a,
const A& b)
const
59 bool operator()(
const A& a,
const A& b)
const
65 template <
class F,
class S>
71 PX_CUDA_CALLABLE
PxPair() : first(F()), second(S())
74 PX_CUDA_CALLABLE
PxPair(
const F& f,
const S& s) : first(f), second(s)
77 PX_CUDA_CALLABLE
PxPair(
const PxPair& p) : first(p.first), second(p.second)
88 PX_CUDA_CALLABLE
bool operator==(
const PxPair& p)
const
90 return first == p.first && second == p.second;
92 PX_CUDA_CALLABLE
bool operator<(
const PxPair& p)
const
97 return !(p.first < first) && (second < p.second);
101 template <
unsigned int A>
104 static const unsigned int value =
PxLogTwo<(A >> 1)>::value + 1;
109 static const unsigned int value = 0;
112 template <
typename T>
117 template <
typename T>
123 template <
typename T>
124 T PxPointerOffset(
void* p, ptrdiff_t offset)
126 return reinterpret_cast<T
>(
reinterpret_cast<char*
>(p) + offset);
128 template <
typename T>
129 T PxPointerOffset(
const void* p, ptrdiff_t offset)
131 return reinterpret_cast<T
>(
reinterpret_cast<const char*
>(p) + offset);
135 PX_CUDA_CALLABLE
PX_INLINE void PxSwap(T& x, T& y)
Definition PxBasicTemplates.h:67
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition PxBasicTemplates.h:40
Definition PxBasicTemplates.h:58
Definition PxBasicTemplates.h:49
Definition PxBasicTemplates.h:103
Definition PxBasicTemplates.h:114