Thread overview
new C++ 8.29.12 beta
Jul 18, 2002
Walter
Jul 18, 2002
Walter
Jul 18, 2002
Christof Meerwald
Jul 19, 2002
Robert M. Münch
Jul 22, 2002
Heinz Saathoff
Jul 22, 2002
Robert M. Münch
Jul 18, 2002
Christof Meerwald
Jul 18, 2002
Christof Meerwald
Jul 18, 2002
Christof Meerwald
July 18, 2002
More template bugs fixed (thanks Chrisof!).


www.digitalmars.com/dmc/dmcppDownload.html




July 18, 2002
"Walter" <walter@digitalmars.com> wrote in message news:ah601r$ica$1@digitaldaemon.com...
> More template bugs fixed (thanks Chrisof!).

I meant Christof, sorry!


July 18, 2002
a small variation from yesterday's bug report:

template<class T>
struct B
{ };


template<class T>
struct A
{
  typedef A<T> &(*f_t)(A<T>&);

  A<T> &operator<<(f_t f) { return f(*this); }

  A<T> &operator<<(B<T> *b) { return *this; }
};


template <class T>
A<T> &f(A<T> &a)
{
  return a;
}



int main(int argc, char *argv[])
{
  A<char> a;

  a << f;
  // Internal error: cpp 2125

  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 18, 2002
and another one:

struct A
{
  template <class T>
  explicit A(T x)
  // Error: function expected
  // Internal error: template 1554
  { }
};


int main()
{
  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 18, 2002
another one:

template<class T>
struct A
{ };

template<>
struct A<int>
{ };

template <class T>
int operator +(const T &a, const A<T> &b)
{
  return 0;
}

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

  return i + a;
  // Error: illegal operand types
  // Had: int
  // and: A<int >
}


bye, Christof

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

...and what have you contributed to the Net?
July 18, 2002
and one more:

template<class T>
struct A
{ };

template<>
struct A<int>
{ };


template <class T>
int operator +(const T &a, const A<T> &b)
{
  return 1;
}

template <class T>
int operator +(const A<T> &a, const A<T> &b)
{
  return 1;
}


template <>
int operator +(const int &a, const A<int> &b)
{
  return 0;
}

template <>
int operator +(const A<int> &a, const A<int> &b)
{
  return 1;
}


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

  return i + a;
  // Error: ambiguous reference to symbol
  // Had: operator +(const A<>&,const A<>&)
  // and: operator +(int const &,const A<>&)
}


bye, Christof

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

...and what have you contributed to the Net?
July 19, 2002
Hi, I'm not sure if we had this one here:

template <class Type> class Test {
 Test(const Test<Type>& other);
};

template <class Type> Test<Type>::Test<Type>(const Test<Type>&  other) {}

sc template.cpp
template.cpp(5) : Error: function expected
Internal error: template 1554
--- errorlevel 1

--
Robert M. Münch
IT & Management Freelancer
Mobile: +49 (0)177 2452 802
Fax   : +49 (0)721 8408 9112
Web   : http://www.robertmuench.de



July 22, 2002
Robert M. Münch schrieb...
> template <class Type> class Test {
>  Test(const Test<Type>& other);
> };
> 
> template <class Type> Test<Type>::Test<Type>(const Test<Type>&  other) {}
                                        ^^^^^^
Is the second <type> allowed? I thought this should be written as

template <class Type> Test<Type>::Test(const Test<Type>&  other) {}


Regards,
	Heinz
July 22, 2002
"Heinz Saathoff" <hsaat@bre.ipnet.de> schrieb im Newsbeitrag news:MPG.17a5cc0d1875222a9896aa@news.digitalmars.com...

> Is the second <type> allowed? I thought this should be written as
>
> template <class Type>
> Test<Type>::Test(const Test<Type>&  other) {}

I'm not sure I got this case out of an app wirtten for MSVC++. There it was used... Robert