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: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.
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: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.