i have in .cpp:
Code:
template <typename T> T& SUtilsLib::Property(CBaseEntity* pBase, const char* pClass, const char* pProp)
{
return *reinterpret_cast<T*>(reinterpret_cast<char*>(pBase) + FindOffset(pClass, pProp));
}
template <typename T> T& SUtilsLib::Property(CBaseEntity* pBase, int index)
{
return *reinterpret_cast<T*>(reinterpret_cast<char*>(pBase) + index);
}
in .h
Code:
class SUtilsLib
{
public:
//...
// Set or Get an Property by name.
template <typename T> T& Property(CBaseEntity* pBase, const char* pClass, const char* pProp);
// Set or Get an Property by index.
template <typename T> T& Property(CBaseEntity* pBase, int index);
//...
};
when i try useit like:
Code:
spt_utils.Property<string_t>(pWeapon, td->fieldOffset[0]) = MAKE_STRING("new_weapon_ak47");
give unresolved external problems in VS2005.
all others funcs in spt_utils works well.
this also happen when i use inline functions in a class
how can i put that in a class without give that errors any c++ option?
thanks