MESSAGE
DATE | 2011-05-24 |
FROM | Ruben Safir
|
SUBJECT | Re: [NYLXS - HANGOUT] [ruben@mrbrklyn.com: Re:
|
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; }
|
|