Mercurial > projects > dwt-mac
diff dwt/dwthelper/WeakRef.d @ 7:e831403a80a9
Add 'cast' to casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:30:35 +0200 |
parents | 380af2bdd8e5 |
children | 30a762abda2a |
line wrap: on
line diff
--- a/dwt/dwthelper/WeakRef.d Wed Aug 27 14:10:03 2008 +0200 +++ b/dwt/dwthelper/WeakRef.d Wed Aug 27 14:30:35 2008 +0200 @@ -20,7 +20,7 @@ class Something {} auto a = new Something(); - auto wa = new WeakRef!(Something)(a); + auto wa = new WeakRef!cast(Something)(a); std.gc.fullCollect(); // Reference 'a' prevents collection so wa.ptr is non-null @@ -36,7 +36,7 @@ * Author: William V. Baxter III * Contributors: * Date: 21 Jan 2008 - * Copyright: (C) 2008 William Baxter + * Copyright: cast(C) 2008 William Baxter * License: Public Domain where allowed by law, ZLIB/PNG otherwise. */ //=========================================================================== @@ -45,8 +45,8 @@ private { alias void delegate(Object) DisposeEvt; - extern (C) void rt_attachDisposeEvent( Object obj, DisposeEvt evt ); - extern (C) void rt_detachDisposeEvent( Object obj, DisposeEvt evt ); + extern cast(C) void rt_attachDisposeEvent( Object obj, DisposeEvt evt ); + extern cast(C) void rt_detachDisposeEvent( Object obj, DisposeEvt evt ); } class WeakRef(T : Object) { @@ -77,7 +77,7 @@ return new WeakRef(ptr()); } int opEquals( Object o ){ - if( auto other = cast( WeakRef!(T) )o ){ + if( auto other = cast( WeakRef!cast(T) )o ){ return other.cast_ptr_ is cast_ptr_; } return false;