From -1641345692207135651
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,4ace508b96ee1ef0,start
X-Google-Attributes: gidf78e5,public
From: "Alexey N. Solofnenko" <trelony@typhoon.spb.ru>
Subject: Who said in C++ there are no functions with different result types and same signatures?
Date: 1998/01/05
Message-ID: <34B0C280.F532D84A@typhoon.spb.ru>#1/1
X-Deja-AN: 313011443
X-Original-Date: Mon, 05 Jan 1998 14:22:40 +0300
Content-Type: multipart/mixed; boundary="------------782D76C4D963E03E5E07AB23"
Organization: Typhoon Software, Inc.
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBNLEYj0y4NqrwXLNJAQEtegIArWLKtU0D1z3AfxUdqvgXyHHfD4SR1cAm yn9Erior15GKUKCnNJ2jQK72u66QRFVGNpTEHNPksBVJ4k+EOA3MIA== =IZWC
Reply-To: trelony@typhoon.spb.ru
Newsgroups: comp.std.c++
Originator: austern@isolde.mti.sgi.com


This is a multi-part message in MIME format.
--------------782D76C4D963E03E5E07AB23
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit

Hi!

  Don't say I am wrong, there are no such functions. I know it (and don't like it). But there
is one exception - casting operators. It can help us to write something which will look like
several functions with different result types.

class foo {
  public:
    foo (_arglist) : arglist(_alglist) {}
    operator T1() { do_smth1;}
    operator T2() { do_smth2;}
    ............

  private:
    arglist;
};

And now we can write :

  T1 t1=foo(...);
  T2 t2=foo(...); // different calls !!!!

As in case with static methods and since it can be emulated maybe it is good idea to include
the
possibility of defining such functions in the standard?

Best wishes,
  Alexey.



--------------782D76C4D963E03E5E07AB23
Content-Type: text/x-vcard; charset=koi8-r; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Alexey N. Solofnenko
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Alexey N. Solofnenko
n:              Solofnenko;Alexey N.
org:            Typhoon Software, Inc.
adr:            ;;;St. Petersburg;;;Russia
email;internet: trelony@typhoon.spb.ru
title:          programmer
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------782D76C4D963E03E5E07AB23--
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



