home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!agate!netsys!news!lsi!mhost!cl301!ameesh
- From: ameesh@lsil.com (Ameesh Desai)
- Newsgroups: comp.lang.c++
- Subject: Re: template question
- Message-ID: <1992Nov10.212645.21472@lsil.com>
- Date: 10 Nov 92 21:26:45 GMT
- References: <1992Nov9.121452.22811@aber.ac.uk>
- Sender: news@lsil.com (news caster)
- Reply-To: ameesh@lsil.com
- Organization: LSI Logic Corporation
- Lines: 33
- Nntp-Posting-Host: cl301
-
- In article 22811@aber.ac.uk, brw@aber.ac.uk (Benjamin Roy Whittle) writes:
- >
- > If I write the following
- >
- >template<class T>
- >class stack { /* public interface stuff push pop etc*/};
- >
- >but I want to say that the class T should have a function copy available
- >for objects of that class, so that the function can be used in the
- >implementation of the stack.
- >
- >How do I do it please?
- >
- >email appreciated.
- >
- >ben
- >
- >brw@aber.ac.uk
-
-
- You can't see ARM Page 343 ... "Specifying no restrictions on what types can match
- a type argument gives the programmer the maximum flexibility. The cost is that errors
- ... will not in general detected until link time...."
-
- Hopefully the linker generates an appropriate error message.
-
- Ameesh
- ---
- ______________________________ o__
- | _ /| Ameesh Desai \ ,>/_
- | \`O.o' LSI Logic Corp. \__(_)`(_)_ email: ameesh@lsil.com
- | =(_|_)= MS E192, 1501 McCarthy Blvd. \ fax : (408) 433-6802
- |____U_______Milpitas, CA 95035____________\____________voice: (408) 433-4097
-