VC6 vs VC7 function overloading

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JMon

    #1

    VC6 vs VC7 function overloading

    I have a string class that overloads the const char* operator as
    follows:

    mystring::opera tor const char* () const
    {
    return this->c_str();
    }

    I have another class the overloads one of is functions as follows:

    void myclass::func(m ystring& x)
    {
    // do something
    }
    void myclass::func(c onst char* x)
    {
    func(mystring(x ));
    }

    With VC6 the 2nd func() calls the first func(), but with VC7 it calls
    itself. Any ideas why this is and which compiler is correct?
Working...