MESSAGE
DATE | 2011-05-24 |
FROM | Ruben Safir
|
SUBJECT | Re: [NYLXS - HANGOUT] [ruben@mrbrklyn.com: Re:
|
From owner-hangout-outgoing-at-mrbrklyn.com Tue May 24 13:30:17 2011 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix) id 94E6A100B18; Tue, 24 May 2011 13:30:17 -0400 (EDT) Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix, from userid 28) id 858F5100B20; Tue, 24 May 2011 13:30:17 -0400 (EDT) Delivered-To: hangout-at-nylxs.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by www2.mrbrklyn.com (Postfix) with ESMTP id 3A57B100B18 for ; Tue, 24 May 2011 13:30:17 -0400 (EDT) Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id CC68032FFC for ; Tue, 24 May 2011 13:30:38 -0400 (EDT) Received: by panix5.panix.com (Postfix, from userid 20529) id B9DD22424F; Tue, 24 May 2011 13:30:38 -0400 (EDT) Date: Tue, 24 May 2011 13:30:38 -0400 From: Ruben Safir To: hangout-at-nylxs.com Subject: Re: [NYLXS - HANGOUT] [ruben-at-mrbrklyn.com: Re: [mrbrklyn-at-panix.com: Template Argument type deterination]] Message-ID: <20110524173038.GA20420-at-panix.com> References: <20110524172525.GC21131-at-panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110524172525.GC21131-at-panix.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: hangout-at-mrbrklyn.com
Path: reader1.panix.com!panix!not-for-mail From: Ruben Safir Newsgroups: comp.lang.c++ Subject: Re: Template argument determination Date: Tue, 24 May 2011 15:04:29 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 34 Message-ID: References: NNTP-Posting-Host: www2.mrbrklyn.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: reader1.panix.com 1306249469 3672 96.57.23.82 (24 May 2011 15:04:29 GMT) X-Complaints-To: abuse-at-panix.com NNTP-Posting-Date: Tue, 24 May 2011 15:04:29 +0000 (UTC) X-Blackjet: Blackjet is a Yankee Fan X-DRMisTHEFT: Use GNU Linux today X-From: A Dark Cloud X-LOCATION: Brooklyn NY - Forget abou' it! X-NYLXS: Really - yah think computers are supposed to be broken? User-Agent: Pan/0.133 (House of Butterflies) Xref: panix comp.lang.c++:1085259
Lets look at it this way
why does this fail to compile
template void test_me(stats::Distribution hello){ std::cout << "I recied an int and converted it to an object " << hello << std::endl; }
int main ( int argc, char *argv[] ){ int a = 7; test_me(a);
return EXIT_SUCCESS; }
yet this does, with the promotion of the int to a distribution object
template void test_me(stats::Distribution hello){ std::cout << "I received an int and converted it to an object " << hello << std::endl; }
int main ( int argc, char *argv[] ){ int a = 7; test_me(a);
return EXIT_SUCCESS; }
|
|