std::transform problem

T

tech

Hi, I am trying to use the std::transform as follows

where buf is short*

m_SendData is std::vector<unsigned char>

class CCodec
{
public:
CCodec() {};
virtual ~CCodec(){};

virtual unsigned char Encode(short ibuf ) = 0;

virtual short Decode(unsigned char ibuf) = 0;
};

m_Codec is *CCodec but pointing at concrete implementation

std::transform(buf, buf + LEN, std::back_inserter(m_SendData), m_Codec-


I get the following errors from VC++ (Visual Studio 8). How to
correct? Thanks

error C3867: CCodec::Encode': function call missing argument list;
use &CCodec::Encode' to create a pointer to member
..: error C2780: '_OutIt
std::transform(_InIt1,_InIt1,_InIt2,_OutIt,_Fn2)' : expects 5
arguments - 4 provided
C:\Program Files\Microsoft Visual Studio 8\VC\ce\include
\algorithm(797) : see declaration of 'std::transform'
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top