http://d.puremagic.com/issues/show_bug.cgi?id=8563
Maxim Fomin <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Maxim Fomin <[email protected]> 2013-02-18 09:06:35 PST --- Reduced struct DirEntry { string name; } struct DirIteratorImpl { DirEntry _cur; @property bool empty(){ return true; } @property DirEntry front(){ return _cur; } void popFront() { } } struct RefCounted { struct RefCountedStore { private struct Impl { DirIteratorImpl _payload; size_t _count; } private Impl* _store; } RefCountedStore _refCounted; ~this() { if (_refCounted._store) _refCounted._store._count = 0; } ref inout(DirIteratorImpl) refCountedPayload() inout { if (_refCounted._store) return _refCounted._store._payload; else throw new Exception("absent"); } alias refCountedPayload this; } struct DirIterator { RefCounted impl; this(string pathname) { throw new Exception(""); } @property bool empty(){ return impl.empty; } @property DirEntry front(){ return impl.front; } void popFront(){ impl.popFront(); } } auto dirEntries(string path) { return DirIterator(path); } void main() { foreach(s; dirEntries("test")) {} } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
