[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] compiler bug?



Carsten Svaneborg har ret!

Carsten Svaneborg wrote:

> Sune Fischer wrote:
> > Det forstår jeg ikke. Hvad skulle forskellen være på:
> Et forslag:
>
> > CMatrix CMatrix::operator*(CMatrix& A)

Jeg ville dog tilføje en const qualifier:
const CMatrix CMatrix::operator * (CMatrix& A);

returværdien (CMatrix)R er og bliver dog en auto variabel!

> Har du husket at definere en copy funktion for matrixer?
> Dvs. CMatrix CMatrix::operator=(CMatrix& A)?

Assignment operator (operator =) er implicit defineret for enhver class
(hvor den ikke er explicit erklæret!)
(er denne defineret korrekt)

Her er er dog tale om en assignment constructor:
returværdi= CMatrix(const CMatrix&)
denne er også implicit defineret hvor den ikke er explicit erklæret.
(er også denne om nødvendigt defineret korrekt?)

Som curriosum mener Bjarne Stroustrup at operatorer der ikke har
sidevirkninger på en class bør erklæres som non-member functions.



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *