N
Nitin Bhardwaj
Thanx in advance for the response...
I wanna enquire ( as it is asked many a times in Interviews that i
face as an Engg PostGraduate ) about the overloading capability of the
C++ Language.
Why can't the = (assignment) operator be overloaded as a friend
function ?
I work in VS 6.0 ( Win2000 ) as when i referred the MSDN documen'n it
said the following :
The operators [] , -> , = cannot be overloaded as static functions
from which i figured out that since 'friend' qualifier makes the
function a static function( i.e. a per-class member ), hence =
operator can't be overloaded as a friend function.But why is such
restrction there in the language in the first place ???
I wanna enquire ( as it is asked many a times in Interviews that i
face as an Engg PostGraduate ) about the overloading capability of the
C++ Language.
Why can't the = (assignment) operator be overloaded as a friend
function ?
I work in VS 6.0 ( Win2000 ) as when i referred the MSDN documen'n it
said the following :
The operators [] , -> , = cannot be overloaded as static functions
from which i figured out that since 'friend' qualifier makes the
function a static function( i.e. a per-class member ), hence =
operator can't be overloaded as a friend function.But why is such
restrction there in the language in the first place ???