Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #5717

Re: templates - method return value is multiple types

From Ruben Safir <mrbrklyn@panix.com>
Newsgroups comp.lang.c++
Subject Re: templates - method return value is multiple types
Date 2011-05-27 17:58 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <iroonm$fp6$1@reader1.panix.com> (permalink)
References <19943379-d9de-42c0-94d3-f1eb54f5788b@b42g2000yqi.googlegroups.com> <return-type-20110527194903@ram.dialup.fu-berlin.de>

Show all headers | View raw


Stefan Ram <ram@zedat.fu-berlin.de> wrote:
> Christopher <cpisz@austin.rr.com> 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

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

templates - method return value is multiple types Christopher <cpisz@austin.rr.com> - 2011-05-27 10:45 -0700
  Re: templates - method return value is multiple types Ruben Safir <mrbrklyn@panix.com> - 2011-05-27 17:58 +0000
    Re: templates - method return value is multiple types Sam <sam@email-scan.com> - 2011-05-27 13:37 -0500
      Re: templates - method return value is multiple types Sam <sam@email-scan.com> - 2011-05-27 14:47 -0500
        Re: templates - method return value is multiple types Christopher <cpisz@austin.rr.com> - 2011-05-27 12:49 -0700
        Re: templates - method return value is multiple types Paavo Helde <myfirstname@osa.pri.ee> - 2011-05-27 16:08 -0500
        Re: templates - method return value is multiple types Sam <sam@email-scan.com> - 2011-05-27 17:17 -0500
    Re: templates - method return value is multiple types "Parkitesta Arctonium" <buh@blither.noet> - 2011-05-29 08:53 -0700
  Re: templates - method return value is multiple types Victor Bazarov <v.bazarov@comcast.invalid> - 2011-05-27 16:16 -0400

csiph-web