Previous 199869 Revisions Next

r20631 Thursday 31st January, 2013 at 13:54:11 UTC by Oliver Stöneberg
removed unused crosscast() function from emucore.h (nw)
[src/emu]emucore.h

trunk/src/emu/emucore.h
r20630r20631
381381}
382382
383383
384// template function for cross-casting from one class to another that throws a bad_cast
385// exception instead of returning NULL
386template<class _Dest, class _Source>
387inline _Dest crosscast(_Source *src)
388{
389   _Dest result;
390#ifdef MAME_DEBUG
391   try
392   {
393#endif
394      result = dynamic_cast<_Dest>(src);
395#ifdef MAME_DEBUG
396   }
397   catch (std::bad_cast &)
398   {
399      report_bad_cast(typeid(src), typeid(_Dest));
400   }
401#endif
402   assert(result != NULL);
403   if (result == NULL)
404      throw std::bad_cast();
405   return result;
406}
407384
408
409
410385//**************************************************************************
411386//  FUNCTION PROTOTYPES
412387//**************************************************************************

Previous 199869 Revisions Next


© 1997-2024 The MAME Team