OFB encode process in C++

/**
@parma T : block object
@parma FUNCTION_T : encryption functor type
@param target[in] encryption data block object (POD ok)
@param src[in] initial vector
@param count[in] number of target
@param encode_functor[in] encryption functor
*/

template<typename T,class FUNCTION_T>
inline T *ofb_encode_process(T *target,const T &src,
size_t count,FUNCTION_T encode_func)
{
size_t i;
T ref_t = encode_func(src);;
for(i=0;i<count;i++)
{
target[i] ^= ref_t;
ref_t = encode_func(ref_t);
}
return target;
}