D
darkstorm
Consider this:
template<typename T_fp>class TRigidBody : public BaseObject
{
public:
template<typename T_fp>class TRigidBody : public BaseObject
{
public:
darkstorm said:Consider this:
template<typename T_fp>class TRigidBody : public BaseObject
{
public:
.
.
//member functions
.
.
//Current state of the rigid body
typedef struct TRB_state
{
RB_state(){}
TRB_state(){}
//data members
}RB_state;
inline RB_state GetRBState(uint8 state_id) const;
private:
//data members of rigidbody
///<Current state of the rigid body
RB_state m_state[2];
};
template<typename T_fp>
(error)----->inline TRigidBody<T_fp>::RB_state
TRigidBody<T_fp>::GetRBState(uint8 state_id) const
{
return m_state[state_id];
}
When compiling I am getting this error:
error C2143: syntax error : missing ';' before
'TRigidBody<T_fp>::GetRBState'
Somebody please explain it...
darkstorm said:Thanks for the reply. I couldn't make it compile that way. Instead of
returning a refernce to RB_state, I tried passing it as a reference
parameter. Then it worked fine.
template<typename T_fp>
inline void TRigidBody<T_fp>::GetRBState(RB_state &state, uint8
state_id) const
{
state = m_state[state_id];
}
although, I have to copyback once the modification is complete....
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.