Re: subclassing question
PaulH <paul.heil@gmail.com> wrote:
My only reason for using the same name was to make it obvious that it
had the same use as the original function. Similar to how "int WINAPI
MessageBox( HWND, LPCWSTR, LPCWSTR, UINT )" and "int
MessageBox( LPCTSTR, LPCTSTR, UINT ) throw()" have the same name, but
different signatures depending on the context in which they are used.
As a result of this choice, when you are inside, say, a method of a
class derived from MFC's CWnd but want to call WinAPI's MessageBox (the
one that takes HWND as the first parameter), you have to write
::MessageBox(...) (note the scope resolution operator :: in front).
Otherwise, the compiler only sees the member function named MessageBox,
and complains about mismatched parameters.
Similarly, in your case you could use scope resolution to avoid the
error:
instance.ClassA<int>::SomeFunction( 1, 2, 3 );
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925