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++ - template constructor + template assignment operator

template<typename T>
struct A
{
  A()
  { }

  template<typename V>
  A(V v)
  { }

  A(const A &a)
  { }

  template<typename V>
  A &operator =(V v)
  {
    return *this;
  }
};

int main()
{
  A<int> a;
  a = a;

  return 0;
}


The compiler crashes when trying to compile this code.

Extracted from Boost.Function - a workaround is available (see
boost/function/function_base.hpp, BOOST_FUNCTION_TARGET_FIX).


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Dec 23 2002