help in template class

N

Naren

Hello Grp,
I think I have understood little of this example,though the
first_argument_type is not used,Can a reference to the derived class be one
of base class members.
And what is the use of it

All advices are welcome


class binary_test : public binary_function<binary_test &,int,float>
{
public:
float value;
binary_test(){value=10.0;}
binary_test(float x){value=x;}
result_type operator<<(second_argument_type arg2);
};

binary_test::result_type
binary_test::eek:perator<<(binary_test::second_argument_type arg2)
{
value = (float)(((int)value) << arg2);
cout << "New value after shift is " << value << endl;
return value;
}

int main(void)
{
binary_test item;

cout << "Begin" << endl;
item = item << 2;

return 0;
}

Thaanx in advance

Rgds,
Naren.
 

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
474,141
Messages
2,570,813
Members
47,357
Latest member
sitele8746

Latest Threads

Top