🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c++
Article #314

Re: Typ Konversion

#314
From: Bernd Eggink
Date: Fri, 25 Aug 1995 14:46
40 lines
1498 bytes
Bernd Braun (braun@stahlw00.stahl.bau.tu-bs.de) wrote:
>  Hallo,

>  Ich bin mir nicht sicher, ob Typ-Casting mit eigenen Klassen geht.
>  In einer Matrix-Klasse benutze ich den Copy-Constructor, um aus einem
>  Vektor eine Matrix zu erzeugen. Das ist eine echte Umwandlung und nicht 
>  nur eine andere Interpretation.
>  Bsp:

>  template <class T> class Matrix
>  {
>  ..
>     Matrix   ( const Matrix<T>& );
>     Matrix   ( const Vector<T>& );
>  ..
>  }
>  template <class T> Matrix<T>::Matrix ( const Vector<T>& a )
>  {
>  ..
>  }

>  In einem Programm koennte man das so anwenden:
>  Vector<int> V;
>  Matrix<int> M;

>  M = M * V;

>  Aus dem Vektor V wird eine temporaere Matrix erzeugt und diese mit M
>  multipliziert (mit M.operator*).

Prima! Und wo ist das Problem??

	Bernd

--
+----------------------------------+
|          Bernd Eggink            |
|    Rechenzentrum Uni Hamburg     |
| admin@rzaix13.rrz.uni-hamburg.de |
+----------------------------------+
Technical Details
Message-ID: <41knnn$3p1@rzsun02.rrz.uni-hamburg.de>
Path: arc1-ca.pugleaf.net!news.rrz.uni-hamburg.de!rzaix13!admin
References: <41ce20$q0v@rs18.hrz.th-darmstadt.de> <41hns6$l78@ra.ibr.cs.tu-bs.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.rrz.uni-hamburg.de!rzaix13!admin
From: admin@rzaix13.uni-hamburg.de (Bernd Eggink)
Newsgroups: de.comp.lang.c++
Subject: Re: Typ Konversion
Date: 25 Aug 1995 14:46:15 GMT
Organization: University of Hamburg -- Germany
Distribution: world
Message-ID: <41knnn$3p1@rzsun02.rrz.uni-hamburg.de>
References: <41ce20$q0v@rs18.hrz.th-darmstadt.de> <41hns6$l78@ra.ibr.cs.tu-bs.de>
NNTP-Posting-Host: rzaix13.rrz.uni-hamburg.de
X-Newsreader: TIN [version 1.2 PL2]