non member operator & overloading
From: harry (harry_at_discussions.microsoft.com)
Date: 06/21/04
- Next message: P.J. Plauger: "Re: how to use hash_map with char*?"
- Previous message: Faisal M. Yaqoob: "how to use hash_map with char*?"
- Next in thread: James Curran: "Re: non member operator & overloading"
- Reply: James Curran: "Re: non member operator & overloading"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Jun 2004 06:41:01 -0700
template < class T >
class Overload
{
public:
Overload();
~Overload();
};
template < class T >
Overload < T >::Overload()
{
};
template < class T >
Overload < T >::~Overload()
{
};
template < class T >
Overload < T > * operator &(Overload < T > & lhs)
{
return &lhs;
}
int main()
{
Overload < int > lhs;
&lhs;
return (0);
}
This code gives the following warning while compiling on VC 7. Please let me know the how to get away with this warning? ( I want to use this as non member only )
: warning C4717: 'operator&<int>' : recursive on all control paths, function will cause runtime stack overflow
- Next message: P.J. Plauger: "Re: how to use hash_map with char*?"
- Previous message: Faisal M. Yaqoob: "how to use hash_map with char*?"
- Next in thread: James Curran: "Re: non member operator & overloading"
- Reply: James Curran: "Re: non member operator & overloading"
- Messages sorted by: [ date ] [ thread ]