Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 21, 2002 new C++ 8.29.13 beta | ||||
---|---|---|---|---|
| ||||
More template bugs fixed (thanks Christof!). Rewrote most of the partial specialization matching code. www.digitalmars.com/dmc/dmcppDownload.html |
July 21, 2002 Re: new C++ 8.29.13 beta | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | A simple "std::cout << "Hello world" << std::endl;" using STLport's iostreams seems to be a good test-case:
template<class T>
struct A
{ };
template<class T>
struct B
: public A<T>
{
typedef A<T> &(*f1_t)(A<T>&);
typedef B<T> &(*f2_t)(B<T>&);
B<T> &operator<<(f1_t f) { f(*this); return *this; }
B<T> &operator<<(f2_t f) { return f(*this); }
};
template <class T>
B<T> &f(B<T> &a)
{
return a;
}
int main(int argc, char *argv[])
{
B<char> a;
a << f;
// Error: ambiguous reference to symbol
// Had: B<char >::operator <<(A<char >&(*C func)(A<char >&))
// and: B<char >::operator <<(B<char >&(*C func)(B<char >&))
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 21, 2002 Re: new C++ 8.29.13 beta | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | DM seems to get confused by the first two operators:
template<class T, class T2>
struct A
{ };
template <class T, class T2>
int operator<<(A<T, T2>& a, const T *s)
{
return 1;
}
template <class T, class T2>
int operator<<(A<T, T2> &a, const char *s)
{
return 2;
}
template <class T2>
int operator<<(A<char, T2> &a, const char *s)
{
return 0;
}
int main(int argc, char *argv[])
{
A<char, int> a;
return a << "";
// Error: ambiguous reference to symbol
// Had: operator <<(A<>&,char const *)
// and: operator <<(A<>&,char const *)
}
bye, Christof
--
http://cmeerw.org JID: cmeerw@jabber.at mailto cmeerw at web.de
...and what have you contributed to the Net?
|
July 22, 2002 Re: new C++ 8.29.13 beta | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter |
Walter wrote:
> More template bugs fixed (thanks Christof!). Rewrote most of the partial specialization matching code.
>
> www.digitalmars.com/dmc/dmcppDownload.html
Wow, these come so fast I can't keep up. Thanks.
BTW the web page says the files are 800,000 bytes but they are actually a lot smaller.
John
|
Copyright © 1999-2021 by the D Language Foundation