mirror of
https://github.com/holub/mame
synced 2025-04-24 09:20:02 +03:00
netlist: type safety for delegates. (nw)
This commit is contained in:
parent
1513c777b4
commit
a80f10e1cf
@ -241,23 +241,28 @@ namespace plib {
|
||||
{
|
||||
public:
|
||||
class generic_class;
|
||||
|
||||
template <class C>
|
||||
using MemberFunctionType = R (C::*)(Targs...);
|
||||
|
||||
pmfp() : pmfp_base<R, Targs...>(), m_obj(nullptr) {}
|
||||
|
||||
template<typename MemberFunctionType, typename O>
|
||||
pmfp(MemberFunctionType mftp, O *object)
|
||||
template<typename O>
|
||||
pmfp(MemberFunctionType<O> mftp, O *object)
|
||||
: pmfp_base<R, Targs...>()
|
||||
{
|
||||
this->set(mftp, object);
|
||||
}
|
||||
|
||||
template<typename MemberFunctionType, typename O>
|
||||
void set(MemberFunctionType mftp, O *object)
|
||||
|
||||
template<typename O>
|
||||
void set(MemberFunctionType<O> mftp, O *object)
|
||||
{
|
||||
this->set_base(mftp, object);
|
||||
m_obj = reinterpret_cast<generic_class *>(object);
|
||||
}
|
||||
|
||||
inline R operator()(Targs... args)
|
||||
inline R operator()(Targs ... args)
|
||||
{
|
||||
return this->call(m_obj, std::forward<Targs>(args)...);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Andrew Gardner, Couriersud
|
||||
#include "netlist/devices/net_lib.h"
|
||||
|
||||
#define USE_FRONTIERS 1
|
||||
#define USE_FRONTIERS 0
|
||||
#define USE_FIXED_STV 1
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
@ -326,8 +326,8 @@ NETLIST_START(kidniki)
|
||||
PARAM(Solver.ACCURACY, 1e-7)
|
||||
PARAM(Solver.NR_LOOPS, 100)
|
||||
PARAM(Solver.GS_LOOPS, 300)
|
||||
PARAM(Solver.METHOD, "MAT_CR")
|
||||
//PARAM(Solver.METHOD, "GMRES")
|
||||
//PARAM(Solver.METHOD, "MAT_CR")
|
||||
PARAM(Solver.METHOD, "GMRES")
|
||||
//PARAM(Solver.SOR_FACTOR, 1.73)
|
||||
//PARAM(Solver.METHOD, "SOR")
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user