79305429

Date: 2024-12-24 11:18:48
Score: 1
Natty:
Report link

Changed this:

template <typename... Args>
void operator()(Args... args) {
        if (ptr)
        static_cast<B<Args...>*>(ptr)->function(std::forward<Args...>(args...)); 
}

To this:

template <typename... Args>
void operator()(Args&&... args) {
    if (ptr)
    static_cast<B<Args...>*>(ptr)->function(std::forward<Args>(args)...);
}
    

Looks like its working correctly

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: widejaw78