digitalmars.D - Exceptions part 2: Incomplete objects
- Sean Kelly <sean f4.ca> Apr 13 2005
- Sean Kelly <sean f4.ca> Apr 13 2005
# /*
# This example demonstrates that the dtors of incomplete
# objects are called during a GC run.
# */
#
# import std.c.stdio;
# import std.gc;
#
# class IC
# {
# this()
# {
# printf( "IC ctor\n" );
# throw new Exception( "IC Exception" );
# }
#
# ~this()
# {
# printf( "IC dtor\n" );
# }
# }
#
# void main()
# {
# try
# {
# IC ic = new IC();
# printf( "success\n" );
# }
# catch( Exception e )
# {
# printf( "fail: %.*s\n", e.toString() );
# }
# fullCollect();
# printf( "done\n" );
# }
Apr 13 2005
Oops, wrong forum. I hit "back" one too many times. Sean
Apr 13 2005








Sean Kelly <sean f4.ca>