Thread overview
new C++ 8.29.10 beta
Jul 11, 2002
Walter
Jul 11, 2002
Christof Meerwald
Jul 12, 2002
Christof Meerwald
Jul 12, 2002
Christof Meerwald
July 11, 2002
Thanks to all your bug reports, lots of template bugs were fixed.


www.digitalmars.com/dmc/dmcppDownload.html




July 11, 2002
On Thu, 11 Jul 2002 13:40:51 -0700, Walter wrote:
> Thanks to all your bug reports, lots of template bugs were fixed.

I am really impressed! Thanks a lot.

Here are 2 remaining issues:

template<class T>
struct A
{
  // it works if you uncomment the following line
  // A() { }

  template<class U>
  A(U u, int x = 0)
  { }
};

int main()
{
  A<char> a(3);
  // Error: cannot find constructor for class matching A<char >::A<char >(int )

  return 0;
}
// END OF FILE



template<class T>
struct A
{
  typedef int V;

  A() { }

  template<class U>
  A(U u, V x = 0)
  // Error: ')' expected
  { }
};

int main()
{
  A<char> a(1);

  return 0;
}



bye, Christof

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

...and what have you contributed to the Net?
July 12, 2002
here is another bug:

struct A
{
  template<class T>
  int f(T a)
  {
    return 0;
  }

  template<class T>
  int f(T a) const
  {
    return 1;
  }
};


int main()
{
  A a;
  const A &b(a);

  return a.f(0) || !b.f(0);
  // Error: ambiguous reference to symbol
  // Had: A::f(T)
  // and: A::f(T)const

  // a.f(0) should return 0 and b.f(0) should return 1
}


bye, Christof

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

...and what have you contributed to the Net?
July 12, 2002
Here is another one:

template<class T>
struct A
{
  T x;

  A()
  { }

  template<class U>
  A(const A<U> &a)
    : x(a.x)
    // Error: need explict cast to convert
    // from: char const *const
    // to  : char const **
  { }
};

template<class T>
bool operator ==(const A<T> &a, const A<T> &b)
{
  return true;
}


int main()
{
  A<const char *> a;
  A<const char **> b;

  return !(b == b) || !(a == a);
}


bye, Christof

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

...and what have you contributed to the Net?