 |
- Timestamp:
- 03/23/10 02:19:11
(2 years ago)
- Author:
- kris
- Message:
added support for retaining the key hash-value (via a -version=HashCache? in the interim)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4456 |
r5421 |
|
| 32 | 32 | Note that when K is specified, support for keys are enabled. When |
|---|
| 33 | 33 | Identity is stipulated as 'true', those keys are compared using an |
|---|
| 34 | | identity-comparison instead of equality (using 'is'). |
|---|
| | 34 | identity-comparison instead of equality (using 'is'). Similarly, if |
|---|
| | 35 | HashCache is set true, an additional attribute is create in order to |
|---|
| | 36 | retain the hash of K |
|---|
| 35 | 37 | |
|---|
| 36 | 38 | *******************************************************************************/ |
|---|
| … | … | |
| 38 | 40 | private typedef int KeyDummy; |
|---|
| 39 | 41 | |
|---|
| 40 | | struct Slink (V, K=KeyDummy, bool Identity = false) |
|---|
| | 42 | struct Slink (V, K=KeyDummy, bool Identity = false, bool HashCache = false) |
|---|
| 41 | 43 | { |
|---|
| 42 | | alias Slink!(V, K) Type; |
|---|
| 43 | | alias Type *Ref; |
|---|
| 44 | | alias Compare!(V) Comparator; |
|---|
| 45 | | |
|---|
| 46 | | |
|---|
| 47 | | Ref next; // pointer to next |
|---|
| 48 | | V value; // element value |
|---|
| | 44 | alias Slink!(V, K, Identity, HashCache) Type; |
|---|
| | 45 | alias Type *Ref; |
|---|
| | 46 | alias Compare!(V) Comparator; |
|---|
| | 47 | |
|---|
| | 48 | Ref next; // pointer to next |
|---|
| | 49 | V value; // element value |
|---|
| | 50 | |
|---|
| | 51 | static if (HashCache == true) |
|---|
| | 52 | { |
|---|
| | 53 | hash_t cache; // retain hash value? |
|---|
| | 54 | } |
|---|
| 49 | 55 | |
|---|
| 50 | 56 | /*********************************************************************** |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2012 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic