Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #5423
| From | Ruben Safir <ruben@mrbrklyn.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Template argument determination |
| Date | 2011-05-24 15:04 +0000 |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Message-ID | <irghds$3io$1@reader1.panix.com> (permalink) |
| References | <ireg6t$5nh$1@reader1.panix.com> <irf6cv$at1$3@reader1.panix.com> <irg3f7$a7e$1@news.ett.com.ua> <irgg84$p4$1@reader1.panix.com> |
Lets look at it this way
why does this fail to compile
template <typename T>
void test_me(stats::Distribution<T> 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 <typename T>
void test_me(stats::Distribution<T> 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<int>(a);
return EXIT_SUCCESS;
}
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar
Template argument determination Ruben Safir <ruben@mrbrklyn.com> - 2011-05-23 20:31 +0000
Re: Template argument determination Ruben Safir <ruben@mrbrklyn.com> - 2011-05-24 02:50 +0000
Re: Template argument determination Michael Doubez <michael.doubez@free.fr> - 2011-05-24 03:48 -0700
Re: Template argument determination "Balog Pal" <pasa@lib.hu> - 2011-05-24 13:06 +0200
Re: Template argument determination Ruben Safir <ruben@mrbrklyn.com> - 2011-05-24 14:44 +0000
Re: Template argument determination Ruben Safir <ruben@mrbrklyn.com> - 2011-05-24 15:04 +0000
Re: Template argument determination "Balog Pal" <pasa@lib.hu> - 2011-05-24 17:33 +0200
Re: Template argument determination Victor Bazarov <v.bazarov@comcast.invalid> - 2011-05-24 11:43 -0400
Re: Template argument determination "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-24 12:32 -0500
Re: Template argument determination Ruben Safir <ruben@mrbrklyn.com> - 2011-05-24 18:08 +0000
Re: Template argument determination "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-24 14:32 -0500
Re: Template argument determination Victor Bazarov <v.bazarov@comcast.invalid> - 2011-05-24 15:48 -0400
Re: Template argument determination "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-24 17:11 -0500
Re: Template argument determination Victor Bazarov <v.bazarov@comcast.invalid> - 2011-05-24 19:04 -0400
Re: Template argument determination "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-25 12:37 -0500
Re: Template argument determination Ruben Safir <ruben@mrbrklyn.com> - 2011-05-26 16:12 +0000
Re: Template argument determination "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-26 13:25 -0500
Re: Template argument determination Ruben Safir <ruben@mrbrklyn.com> - 2011-05-25 02:47 +0000
Re: Template argument determination "Balog Pal" <pasa@lib.hu> - 2011-05-25 10:06 +0200
Re: Template argument determination "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-25 12:40 -0500
csiph-web