Thanks Tim
I know that I failed to have operator for class cmd
and worked out that a code similar to
Code:
bool operator == (const X... &p1, const y...&p2)
{
if( / * evaluate their equality */)
return true;
else
return false;
}
is to be used
being newbie to C I m unable use it
can u please guide how can I do it
my cmd.h is
Code:
#ifndef _CMD_H
#define _CMD_H
enum cmd_t{ADD,SUB};
class cmd{
public:
cmd_t command;
int op_1;
int op_2;
int cmd_id;
cmd(): command(ADD),op_1(0),op_2(0),cmd_id(0) {}
cmd (cmd_t c, int d0, int d1, int id):
command(c),op_1(d0),op_2(d1),cmd_id(id){}
};
std::ostream& operator<<(std::ostream& os, cmd& c);
#endif