Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.readnews.com!news-xxxfer.readnews.com!panix!panix.com!mrbrklyn From: Ruben Safir Newsgroups: comp.lang.c++ Subject: Re: templates - method return value is multiple types Date: Fri, 27 May 2011 17:58:14 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 14 Message-ID: References: <19943379-d9de-42c0-94d3-f1eb54f5788b@b42g2000yqi.googlegroups.com> NNTP-Posting-Host: panix5.panix.com X-Trace: reader1.panix.com 1306519094 16166 166.84.1.5 (27 May 2011 17:58:14 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 27 May 2011 17:58:14 +0000 (UTC) User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (NetBSD/5.1 (i386)) Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:5717 Stefan Ram wrote: > Christopher writes: >>Is it possible to create a method that can return different types > > A function can return an instance of any type that is > a subtype of its declared return type (polymorphism). > what is a subtype? The template book i have makes it fairly clear that changing the subtype, even with partial and explicit specialization, is impossible because it changes the templates signature. Ruben