Files
tp/include/JSystem/JGadget/search.h
T
Jcw87 221f40e609 Remove #includes from headers (#334)
* add "global.h" to files that use it

* add MSL_C includes to files that use them

* remove dolphin includes from headers that don't need them

* remove JSupport includes from headers that don't need them

* remove JKernel includes from headers that don't need them

* remove JUtility includes from headers that don't need them

* remove J3D includes from headers that don't need them

* remove J2D includes from headers that don't need them

* remove JAudio2 includes from headers that don't need them

* remove Z2AudioLib includes from headers that don't need them

* remove JMessage includes from headers that don't need them

* remove JParticle includes from headers that don't need them

* remove SComponent includes from headers that don't need them

* remove dol includes from headers that don't need them

* sort includes
2023-05-12 12:10:14 -07:00

21 lines
540 B
C++

#ifndef SEARCH_H
#define SEARCH_H
#include "dolphin/types.h"
#include "global.h"
namespace JGadget {
//! @todo: mangled name isn't correct, fix this
//! Current: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d
//! Target: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d_RCPFdd_d
template <typename T>
inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& fallback) {
ASSERT(pValue != NULL);
return (idx >= count) ? fallback : pValue[idx];
}
} // namespace JGadget
#endif /* SEARCH_H */