home *** CD-ROM | disk | FTP | other *** search
- Path: hal.COM!spike
- From: spike@hal.com (Spike White)
- Newsgroups: comp.lang.c++
- Subject: Re: Using typedefs in templates (not a FAQ)
- Date: 11 Mar 1996 20:03:39 GMT
- Organization: HAL Computer Systems, Inc.
- Message-ID: <4i20ur$hes@news.hal.com>
- References: <4higv6$7ih@news.hal.com> <4hrb00$8g8@vodka.intele.net>
- NNTP-Posting-Host: zarathustra.hal.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Jonathan Lang (langj@jcave.com) wrote:
- : spike@hal.com (Spike White) wrote:
-
- : >I want to typedef a new type based on the types of the formal template
- : >parameter list. Is that possible?
-
- : >Something like:
-
- : >template <class KEY, class NODEDATA>
- : >class Tree {
- : >public:
- : > typedef int (*pfid)(NODEDATA);
- : > typedef int (*pfi2c)(const KEY, const NODEDATA);
- : >...
- : > pfi2c pfi_compare; // my compare function
- : >...
- : > int trav(pfid); // perform the function on each node
- : >...
- : >}
-
- : This looks valid to me...
-
- Since that time, I've compiled it on Borland C++ on a PC. It compiles
- fine there, which means my C++ compiler at work doesn't support all
- C++ v3.0 semantics.
-
- I was wondering *what* I was doing wrong.
-
- --
- Spike White | spike@hal.com | Biker Nerds
- HaL Software Systems | '87 BMW K75S, DoD #1347 | From HaL
- Austin, TX | http://www.halsoft.com/users/spike/index.html
- Disclaimer: HaL, want me to speak for you? No, Dave...
-