From -7555283733280367816
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,fcf9039f47123dd0,start
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2004-04-27 22:17:30 PST
Path: archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news-in.ntli.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: nesotto@cs.auc.dk ("Thorsten Ottosen")
Newsgroups: comp.std.c++
Subject: Dear All,
Date: Wed, 28 Apr 2004 05:17:28 +0000 (UTC)
Lines: 48
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <408df3b1$0$436$afc38c87@news.optusnet.com.au>
X-Trace: mail2news.demon.co.uk 1083129448 9730 10.0.0.1 (28 Apr 2004 05:17:28 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 28 Apr 2004 05:17:28 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 1BIhRn-0002Wl-00
	for mail2news@news.news.demon.net; Wed, 28 Apr 2004 05:17:27 +0000
X-Received: from mulga.cs.mu.OZ.AU (localhost [127.0.0.1]) by mulga.cs.mu.OZ.AU with ESMTP
	id i3S5HPi2007726; Wed, 28 Apr 2004 15:17:25 +1000 (EST)
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i3S5HNFS007717;
	Wed, 28 Apr 2004 15:17:23 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
X-Spam-Checker-Version: SpamAssassin 2.60-mulga_r1 (1.212-2003-09-23-exp) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=0.7 required=5.2 tests=AWL,PRIORITY_NO_NAME 
	autolearn=no version=2.60-mulga_r1
Xref: archiver1.google.com comp.std.c++:1993

[to moderater: my first post seem to be lost]

Dear All,

Sometimes one choices to change the result of a function template to a
parameter to get type deduction.
For example,

template< class Vector, class Matrix >
void mean_vector( const Matrix&, Vector& );

Matrix m;
Vector v;
...
mean_vector( m, v );

this interacts poorly with a functional style of programming where we would
have written

template< class Vector, class Matrix >
Vector mean_vector( const Matrix& );

Matrix m;
...
Vector v = mean_vector<Vector>( m );

The template argument above seems redundant; why shouldn't we be able to say

Vector v = mean_vector( m );

as if mean_vector() returns a proxy with all possible conversion operators
defined ?

remark: given a templated conversion operator in a proxy we could return the
proxy from mean_vector()
to make it work. However, that incurs a large overhead.

br

Thorsten


---
[ 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://www.jamesd.demon.co.uk/csc/faq.html                       ]



