www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Ambiguous reference to symbol

↑ ↓ ← "W這dzimierz Skiba" <abx abx.art.pl> writes:
Hi!

Using below code I'm getting:

  test.cpp(20) : Error: ambiguous reference to symbol
  Had: tmCluster::GetParts()
  and: tmCluster::GetParts()const
  test.cpp(27) : Error: ambiguous reference to symbol
  Had: tmCluster::GetParts()
  and: tmCluster::GetParts()const

Is that correct?

==========================================================
class tmNode{};

template <class T>
class tmDpptrArray
{
    typedef T* ptr_t;
};

class tmCluster {
public:
  tmDpptrArray<tmNode> mNodes;
  template <class P>
    tmDpptrArray<P>& GetParts();
  template <class P>
    const tmDpptrArray<P>& GetParts() const;
};

template <>
inline tmDpptrArray<tmNode>& tmCluster::GetParts<tmNode>()
{
  return mNodes;
}


template <>
inline const tmDpptrArray<tmNode>& tmCluster::GetParts<tmNode>() const
{
  return mNodes;
}
==========================================================

ABX
Jan 02 2006
↑ ↓ vvvua faust.net.ua writes:
In article <dpbe2a$38r$1 digitaldaemon.com>, W這dzimierz Skiba says...
Hi!

Using below code I'm getting:

  test.cpp(20) : Error: ambiguous reference to symbol
  Had: tmCluster::GetParts()
  and: tmCluster::GetParts()const
  test.cpp(27) : Error: ambiguous reference to symbol
  Had: tmCluster::GetParts()
  and: tmCluster::GetParts()const

Is that correct?

I tryed to compile and everything ok. May be you have to upgrade your gcc. vvvua mhost:~/tmp$ gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib--without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=releasei486-linux-gnu Thread model: posix gcc version 4.0.3 20051201 (prerelease) (Debian 4.0.2-5) vvvua mhost:~/tmp$ Vladimir
Jan 07 2006
↑ ↓ → "W這dzimierz Skiba" <abx abx.art.pl> writes:
vvvua faust.net.ua wrote in news:dpnvrk$2qgs$1 digitaldaemon.com:
 Is that correct?

I tryed to compile and everything ok. May be you have to upgrade your gcc.

Sorry, I don't understand your comment :-( I was reporting build problem in DMC. GCC, Borland, and VC eats that code silently. Comeau on-line compiled this code as well. ABX
Jan 08 2006