This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Template weirdness


On Wed, Nov 24, 1999 at 08:45:06AM -0800, Michael Vance wrote:

As a follow up to my own post ;)

>     template<class T>
>     class LH : public L<T>, public K {
> 	void SK( ks* kp ) {
> 	    k = kp;
> 	};
>     };

This is of course stupid. it should read "k = *kp". I would have
caught this with -Wall ;). But that doesn't change things...

> template<class NFT, class NST>
> class FDLB : public NF::Ks, public LB<NFT, NST> {
> 
> public:
>     FDLB( ) : Ks( ), LB<NFT, NST>( ) { };
> 
>     void II( NFT* t ) {
> 	t->SK( &(Ks::k) );
>     }

Changing this to:

        t->SK( (NF::ks*) &(Ks::k) );

fixed it. But why is this necessary?

m.

-- 
Programmer                         "I wrote a song about dental floss,
Loki Entertainment Software         but did anyone's teeth get cleaner?"
http://lokigames.com/~briareos/              - Frank Zappa, re: the PMRC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]