#include #include class int_ddata : public WCDLink { public: inline int_ddata() {}; inline ~int_ddata() {}; inline int_ddata( int datum ) : info( datum ) {}; int info; }; static void test1( void ); void data_isv_prt( int_ddata * data, void * str ) { cout << (char *)str << "[" << data->info << "]\n"; } void main() { try { test1(); } catch( ... ) { cout << "we caught an unexpected exception\n"; } cout.flush(); } void test1 ( void ) { WCIsvDList list; int_ddata data1(1); int_ddata data2(2); int_ddata data3(3); int_ddata data4(4); int_ddata data5(5); list.exceptions( WCExcept::check_all ); list.append( &data2 ); list.append( &data3 ); list.append( &data4 ); list.insert( &data1 ); list.append( &data5 ); cout << "\n"; list.forAll( data_isv_prt, "" ); data_isv_prt( list.find( 3 ), "" ); data_isv_prt( list.get( 2 ), "" ); data_isv_prt( list.get(), "" ); list.clear(); cout.flush(); }