home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!decwrl!olivea!bu.edu!att!att!allegra!alice!bs
- From: bs@alice.att.com (Bjarne Stroustrup)
- Newsgroups: comp.lang.c++
- Subject: Re: backwards references in templates
- Message-ID: <23643@alice.att.com>
- Date: 8 Sep 92 12:32:47 GMT
- References: <TMB.92Sep7163720@arolla.idiap.ch>
- Distribution: comp
- Organization: AT&T Bell Laboratories, Murray Hill NJ
- Lines: 18
-
-
-
- tmb@arolla.idiap.ch (Thomas M. Breuel @ IDIAP) writes
-
- > The following definition of Foo appears to be illegal (GNU C++ doesn't
- > accept it, and the ARM doesn't seem to sanction it):
- >
- > template <class K,K x>
- > struct Foo {
- > K y;
- > Foo() { y = x; }
- > };
- >
- > This restriction on the uses of template arguments (as in "Foo") is a
- > serious problem, since such dependencies occur frequently.
-
- I see nothing wrong with this example and see nothing in the ARM that
- prohibits it.
-