home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c++:16816 comp.std.c++:1612
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!sgiblab!sgigate!odin!twilight!zola!fido!shankar
- From: shankar@sgi.com (Shankar Unni)
- Newsgroups: comp.lang.c++,comp.std.c++
- Subject: Re: "Invalid" argument(s) in template class declaration, how to realize?
- Date: 24 Nov 1992 01:00:23 GMT
- Organization: Silicon Graphics, Inc.
- Lines: 19
- Message-ID: <1erur7INNkem@fido.asd.sgi.com>
- References: <BxznCM.K9o@math.uwaterloo.ca>
- NNTP-Posting-Host: boris.wpd.sgi.com
- X-Newsreader: Tin 1.1 PL5
-
- Xiaojun Zhu (xjzhu@math.uwaterloo.ca) wrote:
-
- > Q: When designing a template class, how to make sure that its argument
- > can only be certain classes or certain predefined types?
- >
- > Another words, can we build a template class such that it only accepts
- > certain types as its arguments, while for others it will generate an
- > error message such as:
- >
- > This type is not supported by this template.
-
- You can't do that now, but if the proposal for RTTI (Run-Time Type
- Identification) ever gets into the standard in some form, you will be
- able to do this by doing a run-time check (usually statically
- determinable by the compiler).
-
- --
- Shankar Unni E-Mail: shankar@sgi.com
- Silicon Graphics Inc. Phone: +1-415-390-2072
-