[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] : warning: ANSI C++ forbids floating-point templatearguments



On Thu, 2 Sep 1999, gnalle wrote:

> Jeg er ved at lave en klasse, der berskriver en bold i en kasse. Jeg vil
> gerne have at bolden kender kassens brede, for så er der en hel del
> ting, der bliver  lettere. 
> 
> Nu bruger jeg templates på følgende vis 
> 
> template <double kasselaengde; Dimensioner =3>
> class placering:public Point <laesDim>;

Det er vist ikke det rigtige kode, du har semikolon inde i
parameterlisten?

Det giver ikke rigtig mening at lade den være template-parameter. Vil du
virkelig have at kompileren genererer forskellig kode for forskellige
værdier af kasselaengde?

Det er nok bedre at for den at være en member-variabel. Typisk vil man
bruge template-parametre til typer, fx en List < Point >.

Andre ting som med tiden vil give dig problemer: Du blander engelsk og
dansk sammen. "placering", "Point". Hold dig til engelsk.  Brug af
store/små bogstaver er inkonsekvent (Point klasse men placering klasse).


-- 
==============================================================================
Erwin Andreasen   Herlev, Denmark <sslug@sslug>          UNIX System Programmer
<URL:http://www.andreasen.org>              <*>         (not speaking for) DDE
==============================================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 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] *