Article View: comp.sys.mac.programmer.codewarrior
Article #32Re: templatized pointers to member functions (in CW8)
From: R Shapiro
Date: Thu, 01 Feb 1996 20:30
Date: Thu, 01 Feb 1996 20:30
31 lines
1343 bytes
1343 bytes
In article <4er2af$nna@newsroom.hitc.com>, psand@eos.hitc.com (G. Patrick
Sand) wrote:
>>template <class OBJECT>
>>class Test {
>> // (a) This is what I want but it won't compile in CodeWarrior 8:
>> //typedef void (OBJECT::*ObjectMemberFunction)(void);
>>
>> // (b) This works but isn't what I want:
>> typedef void (ATest::*ObjectMemberFunction)(void);
>>
>[snip!]
>>};
>
>I think the answer is NO. A template is a cookie cutter for whatever you
>specify, but it doesn't assume any knowledge about what you specify
>beyond whether it is a class template or a function template.
I'm not asking it to. I just want it to substitute the real class name for
OBJECT in:
typedef void (OBJECT::*ObjectMemberFunction)(void);
just as it does with all other references to OBJECT within the template.
VisualC++ 4.0 does this successfully, by the way.
--
rs/rshapiro@bbn.com
Technical Details
Message-ID:
<rshapiro-0102961530500001@esb.bbn.com>Path:
arc1-ca.pugleaf.net!esb.bbn.com!userReferences:
<rshapiro-0102960833080001@ipa.bbn.com> <4er2af$nna@newsroom.hitc.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!esb.bbn.com!user From: rshapiro@bbn.com (R Shapiro) Newsgroups: comp.sys.mac.programmer.codewarrior,comp.lang.c++ Subject: Re: templatized pointers to member functions (in CW8) Date: Thu, 01 Feb 1996 15:30:49 -0500 Organization: BBN Message-ID: <rshapiro-0102961530500001@esb.bbn.com> References: <rshapiro-0102960833080001@ipa.bbn.com> <4er2af$nna@newsroom.hitc.com> NNTP-Posting-Host: esb.bbn.com