Thanks,
Atman Binstock
> Could someone tell me what the current draft standard says
>about uncalled class template members? Need they be checked before
>allowing instantiation of the class?
No. In fact the implementation _must not_ check them (other than
syntax checking).
>For example, if Vector<T>::sort()
>uses operator<(const T&, const T&), can you make a Vector<X>, where X
>does not support operator<, if Vector<X>::sort() is never called?
Yes, you can.
--
Fergus Henderson - f...@munta.cs.mu.oz.au
Yes, you are supposed to be able to provided
Vector<X>::sort() is not _used_. That includes calling it,
but if it is virtual it is also considered "used".
Note quite a few compilers do not yet provide this
functionality.
--
JOHN (MAX) SKALLER, INTERNET:max...@suphys.physics.su.oz.au
Maxtal Pty Ltd,
81A Glebe Point Rd, GLEBE Mem: SA IT/9/22,SC22/WG21
NSW 2037, AUSTRALIA Phone: 61-2-566-2189
The draft standard seems to have it both ways for uncalled virtual methods:
An implementation shall not instantiate a function or a class that
does not require instantiation. However, virtual functions can be
instantiated for implementation purposes.
I'd read that as saying a compliant implementation can reject a class
with a problematical yet uncalled member function if that function is
virtual.
---
~THol()
Thomas Holaday
holaday...@jpmorgan.com
tl...@ibm.net
7040...@compuserve.com
: Yes, you are supposed to be able to provided
: Vector<X>::sort() is not _used_. That includes calling it,
: but if it is virtual it is also considered "used".
What if you explicitly instantiate it?
// fuzzy on syntax here..
template Vector<X>;
--
Tony Cook - to...@online.tmx.com.au
10023...@compuserve.com