ref semantics with hashes
    Steven Schveighoffer 
    schveiguy at yahoo.com
       
    Mon May  7 06:37:45 PDT 2012
    
    
  
On Sat, 05 May 2012 00:11:04 -0400, Kagamin <spam at here.lot> wrote:
> Well, if one needs strictly ref dictionary
> class Dictionary(TKey, TValue)
> {
>    TValue[TKey] dictionary;
>    alias dictionary this;
> }
This is a wasted memory block.  dictionary already has reference semantics  
*as long as* it has been initialized.
The problem is, the only way to initialize it is to add something.  There  
is no current way to create an initialized empty AA.
-Steve
    
    
More information about the Digitalmars-d-learn
mailing list