New signal code did not work well with unbound parameters like 'const Type&' instead of 'Type'

0.8
Bruno Van de Velde 2017-08-30 00:00:54 +02:00
parent c2a6e4d043
commit 1988d34f4a
1 changed files with 5 additions and 1 deletions

View File

@ -648,7 +648,11 @@ namespace tgui
static auto bindImpl(std::index_sequence<Indices...>, Signal& signal, std::function<void(Args...)>&& handler, BoundArgs&&... args)
{
const std::size_t offset = signal.validateTypes({typeid(UnboundArgs)...});
return [=](){ std::invoke(handler, unbind(std::forward<BoundArgs>(args))..., internal_signal::dereference<UnboundArgs>(internal_signal::parameters[offset + Indices])...); };
return [=](){
std::invoke(handler,
unbind(std::forward<BoundArgs>(args))...,
internal_signal::dereference<std::decay_t<UnboundArgs>>(internal_signal::parameters[offset + Indices])...);
};
}
};
}