S
supervixen
I have two overloads of function g :
template<class T> void g (const T* t) { t->foo(); }
template<class T> void g (const T& t) { t.foo(); }
And the following lines of code
C* pc;
g(pc);
produce this error when built with GCC,
......In member function 'void g(const T&) [with T = C*]'.....
....."request for member 'foo' in 'pc' which is of non-class type 'C*
const'
which, on the other hand, compiles, links and executes with no errors
on CC
My configuration is
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-04)
gcc: GCC 3.4.3 csl-sol210-3_4-branch+sol_rpath
dmake : Sun Distributed Make 7.8 SunOS_sparc Patch 126503-01
and i'm working on a Sun OS 5.10, Sparc machine, obviously
Any helps will be appreciated!
template<class T> void g (const T* t) { t->foo(); }
template<class T> void g (const T& t) { t.foo(); }
And the following lines of code
C* pc;
g(pc);
produce this error when built with GCC,
......In member function 'void g(const T&) [with T = C*]'.....
....."request for member 'foo' in 'pc' which is of non-class type 'C*
const'
which, on the other hand, compiles, links and executes with no errors
on CC
My configuration is
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-04)
gcc: GCC 3.4.3 csl-sol210-3_4-branch+sol_rpath
dmake : Sun Distributed Make 7.8 SunOS_sparc Patch 126503-01
and i'm working on a Sun OS 5.10, Sparc machine, obviously
Any helps will be appreciated!