From 2936300569035949599
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,d1b6f1d44466ce7
X-Google-Attributes: gidf78e5,public
From: Stephen Cleary <csclear@my-deja.com>
Subject: Re: [Q] Dependent template arguments
Date: 2000/06/28
Message-ID: <8jcs85$651$1@nnrp1.deja.com>#1/1
X-Deja-AN: 639972460
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <B575744D-A430A@192.109.102.124>
X-Authentication-Warning: backdraft.briar.org: smap set sender to <news@dejanews.com> using -f
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 962198209 mail2news:24936 mail2news mail2news.demon.co.uk
X-Http-Proxy: 1.0 x53.deja.com:80 (Squid/1.1.22) for client 4.18.151.35
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Wed Jun 28 12:49:15 2000 GMT
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-MyDeja-Info: XMYDJUIDcsclear
Newsgroups: comp.std.c++

In article <B575744D-A430A@192.109.102.124>,
  "Gabor Greif" <gabor@no.netopia.com> wrote:
> I am evaluating what degree of dependency of template arguments is
> permitted by the standard...
>
> template <typename T, template <T> class F>
> struct foo {};
>
> Admittedly my example is rather contrived, but I did not find any
hint in
> the standard that this kind of dependency would be disallowed.

Since F is a template template argument, it needs a template parameter
list.  "<T>" is not a template parameter list.

You could do:
  template <typename T, template <T C> class F>
  struct foo {};
where F takes a non-type template argument of type T, or:
  template <typename T, template <typename> class _F>
  struct foo { typedef _F<T> F; };
where F takes a type template argument, which is T, or (if you *really*
want it in the template parameter list):
  template <typename T, template <typename> class _F,
      typename F = _F<T> >
  struct foo {};

        -Stephen Cleary


Sent via Deja.com http://www.deja.com/
Before you buy.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




