Mercurial > projects > dstress
view run/i/inline_13_A.d @ 1609:3c803614a8fb
Add a few missing abstracts.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 26 Apr 2009 13:38:23 +0200 |
parents | b8c0195059d9 |
children |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ Uwe Salomon <post@uwesalomon.de> // @date@ 2005-07-13 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=4525 module dstress.run.i.inline_13_A; struct NodeType(Key, T){ NodeType* next; uint hash; Key key; } struct HashIterator(Key, T){ NodeType!(Key, T)* m_ptr; static HashIterator fromPtr(NodeType!(Key, T)* ptr){ return *(cast(HashIterator*) &ptr); } int opEquals(HashIterator iter){ return (m_ptr == iter.m_ptr); } } struct Hash(Key, T){ alias HashIterator!(Key, T) Iterator; Iterator end(){ return Iterator.fromPtr(null); } } int main(){ Hash!(uint, uint) hash; hash.Iterator iter; if ((iter = hash.end()) == hash.end){ return 0; } assert(0); }