🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #33

using a template parameter as a qualifier -- legal or not?

#33
From: R Shapiro
Date: Tue, 06 Feb 1996 17:58
33 lines
1253 bytes
I'd like to use the formal argument to a template as the qualifier of a
qualified typename within the template. This doesn't work in CodeWarrior
8, it does work in VC++ 4.0, and I can't tell from ARM whether or not it
*should* work.

Here's a more specific example:

template <class OBJECT>
class OrderedCollection {
   typedef void (OBJECT::*memberMapper)(void);
.
.
.
};

I would like the typedef 'memberMapper' to refer to pointers to member
functions (of no arguments and returning no value) of whatever class is
specified in a given instantiation of the template.

For instance, if X and Y are classes, I would expect memberMapper in
OrderedCollection<X> to be:

  void (X::*memberMapper)(void)


and memberMapper in OrderedCollection<Y> to be:

   void (Y::*memberMapper)(void)

Should this work or not? If not, why not? If so -- this is a bug in CW8.

-- 
rs/rshapiro@bbn.com
Technical Details
Message-ID: <rshapiro-0602961258310001@esb.bbn.com>
Path: arc1-ca.pugleaf.net!esb.bbn.com!user

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: using a template parameter as a qualifier -- legal or not?
Date: Tue, 06 Feb 1996 12:58:31 -0500
Organization: BBN
Message-ID: <rshapiro-0602961258310001@esb.bbn.com>
NNTP-Posting-Host: esb.bbn.com