[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
 

Konstante template argumenter i C++



Hej alle

Er dette en valid c++ erklæring:

 template<class T, const std::string & name > 
class osv.

?

Den bliver accepteret af g++ 3.4.4 (peger til eksternt linket objekt, tror 
jeg). Når jeg vil instantiere kan jeg tilsyneladende give enten en 
std::string hej_a( "hej" );
eller
extern const std::string hej_b( "hej" );

som i 
osv<int, hej_a> Hej_a;
og
osv<int, hej_b> Hej_b;

Jeg ville gerne begrænse mine erklæringer til at oversætteren kun accepterer 
const, dvs. af hej_b formen.

Nogen bud?

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
Being comfortable with your beliefs is like being comfortable with
syphilis. Belief is a sort of disease that comes from the ego's need to
protect itself from reality. 
                                       - /. comment on 2002.05.01



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-05-01, 02:01 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] *