std::transform problem

Discussion in 'C++' started by tech, Apr 10, 2008.

  1. tech

    tech Guest

    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-
    >Encode);



    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'
    tech, Apr 10, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven T. Hatton
    Replies:
    4
    Views:
    3,896
    Rob Williscroft
    Dec 5, 2004
  2. Peter Jansson
    Replies:
    5
    Views:
    6,303
    Ivan Vecerina
    Mar 17, 2005
  3. Vinu
    Replies:
    4
    Views:
    356
    Jim Langston
    Jul 7, 2005
  4. Tom Lynch
    Replies:
    2
    Views:
    2,028
    Tom Lynch
    Oct 12, 2007
  5. Ralf Goertz

    std::transform for std::map

    Ralf Goertz, Mar 16, 2009, in forum: C++
    Replies:
    6
    Views:
    2,760
    Ralf Goertz
    Mar 18, 2009
Loading...

Share This Page