template parameters

Charles H. charleshixsn at earthlink.net
Sun Aug 29 18:32:28 UTC 2021


I've set up a class template (so far untested) thus:

     class    AARL (T, ndx = "ndx")
             if (isIntegral(T.init.ndx) )

     If I'm correct, this should work for ndx an integer variable 
of T, but I'd really like T to be able to be anything which can 
be stored both in an array and in an associative array.  But I 
can't figure out how to specify ndx.  After all, T might be a 
float, so it wouldn't have any appropriate attributes.  And I'd 
also like ndx to be able to be a function either a member of the 
class/struct T or a stand alone function.

So how should I set up this template?



More information about the Digitalmars-d-learn mailing list