From 3322713356681131663
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,9da47553ab59d368,start
X-Google-Attributes: gidf78e5,public
From: hursh@sparc.isl.net (hursh)
Subject: template member function syntax
Date: 1999/02/02
Message-ID: <m107X1E-000Q9bC@psalm>#1/1
X-Deja-AN: 439621646
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
X-Original-Date: Mon, 1 Feb 1999 22:00:56 -0600 (CST)
Content-Type: text/plain; charset=US-ASCII
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 917928593 6947 128.250.29.17 (2 Feb 1999 04:09:53 GMT)
Organization: -
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANrZ6guEDnX0m9pzZAQGiHgF+JsDo1aYZSJ8vNRltsiO8yw//VH22cS3U qrmv8ofPZqX7vLAjfpM3H8KOHcYFkH/j =oCYl
Mime-Version: 1.0
NNTP-Posting-Date: 2 Feb 1999 04:09:53 GMT
Newsgroups: comp.std.c++

Hi,

    I recently spent a few hours trying to find the syntax for what I
had expected to be:

     myType mytmp = MyObj.myFunc<myType>();

The `proper' syntax seems to be:

     myType mytmp = MyObj.template myFunc<myType>();
                          ^^^^^^^^?
  I understand the the syntax error of myType being after the
less-than operator, but putting the template keyword in the invocation
just seems plain ugly.  Is there a more convenient way of doing this
that I missed?  If not, was it because this type of
declaration/invoation is considered *bad*, and hence should be made to
look bad?  (Kinda like the newer casts.)

Regards,
Dan Hursh
hursh@infonet.isl.net
---
[ 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              ]



