Thread overview | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 10, 2001 fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
now uploaded in www.digitalmars.com/dmc/dmcppDownload.html |
October 10, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | On Wed, 10 Oct 2001 00:52:44 -0700, Walter wrote in c++.announce: > now uploaded in > www.digitalmars.com/dmc/dmcppDownload.html The included stl_config.h doesn't define __SGI_STL_NO_ARROW_OPERATOR, but it is still needed. bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw@jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net? |
October 10, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | Christof Meerwald wrote in message <9q121r$v0a$1@digitaldaemon.com>... >On Wed, 10 Oct 2001 00:52:44 -0700, Walter wrote in c++.announce: >> now uploaded in >> www.digitalmars.com/dmc/dmcppDownload.html > >The included stl_config.h doesn't define __SGI_STL_NO_ARROW_OPERATOR, but it >is still needed. My tests showed I corrected the error that the define masked. What error are you seeing? |
October 10, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | On Wed, 10 Oct 2001 03:28:47 -0700, Walter wrote: > Christof Meerwald wrote in message <9q121r$v0a$1@digitaldaemon.com>... >>The included stl_config.h doesn't define __SGI_STL_NO_ARROW_OPERATOR, but >> it >>is still needed. > My tests showed I corrected the error that the define masked. What error are you seeing? I am trying to use a simple STL map: #include <map> map<int, int> m; and get: c:/dm/stl\stl_iterator.h(188) : Error: need explict cast to convert from: const pair<int ,int >* to : pair<int ,int >* bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw@jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net? |
October 10, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | On Wed, 10 Oct 2001 09:56:40 +0000 (UTC), Christof Meerwald wrote: > On Wed, 10 Oct 2001 03:28:47 -0700, Walter wrote: >> Christof Meerwald wrote in message <9q121r$v0a$1@digitaldaemon.com>... >>>The included stl_config.h doesn't define __SGI_STL_NO_ARROW_OPERATOR, but > I am trying to use a simple STL map: > #include <map> > map<int, int> m; I have done some more testing on this and have extracted a simple test-case: template<class T> struct A { const T &operator*() const { return t; } T *operator->() const { return &(operator*()); } private: T t; }; struct B { }; A<int> a; A<B> b; The template class instantiation for A<int> works, but the instantiation for A<B> fails with test.cpp(11) : Error: need explict cast to convert from: const B* to : B* So, the compiler is at least a bit inconsistent here. But I am wondering if it is allowed by the C++ standard. bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw@jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net? |
October 10, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | On Wed, 10 Oct 2001 11:29:31 +0000 (UTC), Christof Meerwald wrote: > I have done some more testing on this and have extracted a simple test-case: > template<class T> > struct A > { > const T &operator*() const > { > return t; > } > > T *operator->() const > { > return &(operator*()); > } > > private: > T t; > }; > > struct B > { }; > > A<int> a; > > A<B> b; > > The template class instantiation for A<int> works, but the instantiation for > A<B> fails with > test.cpp(11) : Error: need explict cast to convert > from: const B* > to : B* I guess the problem here is that DM tries to instantiate A<B>::operator-> even if it's never used. I found this in the C++ standard (14.7.1 Implicit instantiation [temp.inst]): 9 An implementation shall not implicitly instantiate a function template, a member template, a non-virtual member function, a member class or a static data member of a class template that does not require instantiation. bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw@jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net? |
October 10, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | Thanks, I'll check it out. Christof Meerwald wrote in message <9q1beq$1br3$1@digitaldaemon.com>... >On Wed, 10 Oct 2001 09:56:40 +0000 (UTC), Christof Meerwald wrote: >> On Wed, 10 Oct 2001 03:28:47 -0700, Walter wrote: >>> Christof Meerwald wrote in message <9q121r$v0a$1@digitaldaemon.com>... >>>>The included stl_config.h doesn't define __SGI_STL_NO_ARROW_OPERATOR, but >> I am trying to use a simple STL map: >> #include <map> >> map<int, int> m; > >I have done some more testing on this and have extracted a simple test-case: > > template<class T> > struct A > { > const T &operator*() const > { > return t; > } > > T *operator->() const > { > return &(operator*()); > } > > private: > T t; > }; > > struct B > { }; > > > A<int> a; > > A<B> b; > > >The template class instantiation for A<int> works, but the instantiation for >A<B> fails with > test.cpp(11) : Error: need explict cast to convert > from: const B* > to : B* > > >So, the compiler is at least a bit inconsistent here. But I am wondering if it is allowed by the C++ standard. > > >bye, Christof > >-- >http://cmeerw.cjb.net Jabber: cmeerw@jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw > >...and what have you contributed to the Net? |
October 11, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Here is a test-case that still doesn't work:
template <class T>
class A
{
};
template <class T1, class T2 = A<T1> >
class B
{
};
template <class T1, class T2 = B<T1> >
// ^
// Error: no type for argument 'T1'
class C
{
};
bye, Christof
--
http://cmeerw.cjb.net Jabber: cmeerw@jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw
...and what have you contributed to the Net?
|
October 12, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | Got it, thanks! Christof Meerwald wrote in message <9q4vp1$9an$1@digitaldaemon.com>... >Here is a test-case that still doesn't work: > > template <class T> > class A > { > }; > > template <class T1, class T2 = A<T1> > > class B > { > }; > > template <class T1, class T2 = B<T1> > > // ^ > // Error: no type for argument 'T1' > class C > { > }; > > >bye, Christof > >-- >http://cmeerw.cjb.net Jabber: cmeerw@jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw > >...and what have you contributed to the Net? |
October 14, 2001 Re: fix for __STL_LIMITED_DEFAULT_TEMPLATES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | Ok, I have this one corrected. I'll wait in posting a new compiler until I investigate your other bug reports. -Thanks, Walter Christof Meerwald wrote in message <9q1beq$1br3$1@digitaldaemon.com>... >On Wed, 10 Oct 2001 09:56:40 +0000 (UTC), Christof Meerwald wrote: >> On Wed, 10 Oct 2001 03:28:47 -0700, Walter wrote: >>> Christof Meerwald wrote in message <9q121r$v0a$1@digitaldaemon.com>... >>>>The included stl_config.h doesn't define __SGI_STL_NO_ARROW_OPERATOR, but >> I am trying to use a simple STL map: >> #include <map> >> map<int, int> m; > >I have done some more testing on this and have extracted a simple test-case: > > template<class T> > struct A > { > const T &operator*() const > { > return t; > } > > T *operator->() const > { > return &(operator*()); > } > > private: > T t; > }; > > struct B > { }; > > > A<int> a; > > A<B> b; > > >The template class instantiation for A<int> works, but the instantiation for >A<B> fails with > test.cpp(11) : Error: need explict cast to convert > from: const B* > to : B* > > >So, the compiler is at least a bit inconsistent here. But I am wondering if it is allowed by the C++ standard. > > >bye, Christof > >-- >http://cmeerw.cjb.net Jabber: cmeerw@jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw > >...and what have you contributed to the Net? |
Copyright © 1999-2021 by the D Language Foundation