Hi everone!
I'm trying to use webrtc api with QT, but I got some errors on base/sigslot.h file while compiling project. Error on this class:
class _opaque_connection
{
private:
typedef void (*emit_t)(const _opaque_connection*);
template< typename FromT, typename ToT >
union union_caster
{
FromT from;
ToT to;
};
emit_t pemit;
has_slots_interface* pdest;
// Pointers to member functions may be up to 16 bytes for virtual classes,
// so make sure we have enough space to store it.
unsigned char pmethod[16];
public:
template< typename DestT, typename ... Args >
_opaque_connection(DestT* pd, void (DestT::*pm)(Args...)) : pdest(pd)
{
typedef void (DestT::*pm_t)(Args...);
static_assert(sizeof(pm_t) <= sizeof(pmethod), "Size of slot function pointer too large.");
std::memcpy(pmethod, &pm, sizeof(pm_t));
typedef void (*em_t)(const _opaque_connection* self, Args...);
union_caster< em_t, emit_t > caster2;
caster2.from = &_opaque_connection::emitter< DestT, Args... >;
}
has_slots_interface* getdest() const { return pdest; }
_opaque_connection duplicate(has_slots_interface* newtarget) const
{
_opaque_connection res = *this;
res.pdest = newtarget;
return res;
}
// Just calls the stored "emitter" function pointer stored at construction
// time.
template< typename ... Args >
void emit(Args... args) const
{
typedef void (*em_t)(const _opaque_connection*, Args...);
union_caster< emit_t, em_t > caster;
caster.from = pemit;
}
private:
template< typename DestT, typename ... Args >
static void emitter(const _opaque_connection* self, Args... args)
{
typedef void (DestT::*pm_t)(Args...);
pm_t pm;
std::memcpy(&pm, self->pmethod, sizeof(pm_t));
(static_cast< DestT* >(self->pdest)->*(pm))(args...);
}
};
error:
expected ')' before '...' token
void emit(Args... args) const
^
what is wrong?
HELP