@teja:
if we use call by value in copy constructor,,
class base
{
int a;
public:
base(int x)
{
a=x;
}
base(base c)
{
}
};
int main()
{
base b(1);
base b1=b;// this ll be seen as base c=b(see the copy constructor)..this ll
in turn call another copy constructor..
return 0;
}
now it ll create a separate object each time you call a copy constructor..so
it ll result in infinite loop..so we have to pass by reference..
On Mon, Sep 19, 2011 at 7:53 PM, teja bala <[email protected]>wrote:
> Does anyone can xplain Function object or functor in C++ with
> example???
>
>
> thx in advance.............
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>
--
*prasanth*
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.